node-red-contrib-tak-registration 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/tak-registration.js +2 -3
package/package.json
CHANGED
package/tak-registration.js
CHANGED
|
@@ -118,8 +118,8 @@ module.exports = function (RED) {
|
|
|
118
118
|
if (msg.hasOwnProperty("attachments") && Array.isArray(msg.attachments) && msg.attachments.length > 0) {
|
|
119
119
|
if (!msg.sendTo) { node.error("Missing 'sendTo' user TAK callsign property.", msg); return; }
|
|
120
120
|
var UUID = uuid.v5(msg.topic, 'd5d4a57d-48fb-58b6-93b8-d9fde658481a');
|
|
121
|
-
var fnam = msg.topic;
|
|
122
|
-
var fname =
|
|
121
|
+
var fnam = msg.topic || msg.attachments[0].filename.split('.')[0];
|
|
122
|
+
var fname = fnam + '.zip';
|
|
123
123
|
var da = new Date();
|
|
124
124
|
var dn = da.toISOString().split('-')[2].split('.')[0];
|
|
125
125
|
var calls = msg.from || node.callsign;
|
|
@@ -173,7 +173,6 @@ module.exports = function (RED) {
|
|
|
173
173
|
mf = mf.replace(/>\s+</g, "><");
|
|
174
174
|
zip.addFile('MANIFEST/manifest.xml', Buffer.from(mf, 'utf8'), msg.topic);
|
|
175
175
|
var zipbuff = zip.toBuffer();
|
|
176
|
-
zip.writeZip("/tmp/takfile.zip")
|
|
177
176
|
|
|
178
177
|
msg = {
|
|
179
178
|
from: msg.from || node.callsign || "Anonymous",
|