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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-tak-registration",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "A Node-RED node to register to TAK and to help wrap files as datapackages to send to TAK",
5
5
  "dependencies": {
6
6
  "@turf/turf": "6.5.0",
@@ -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 = msg.topic + '.zip';
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",