@tiledesk/tiledesk-whatsapp-connector 0.1.20 → 0.1.22

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.
Files changed (2) hide show
  1. package/index.js +8 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -460,6 +460,11 @@ router.post('/tiledesk', async (req, res) => {
460
460
  return res.send(200);
461
461
  }
462
462
 
463
+ if (attributes && attributes.subtype === 'info/support') {
464
+ console.log("Skip subtype: ", attributes.subtype);
465
+ return res.send(200);
466
+ }
467
+
463
468
  let recipient_id = tiledeskChannelMessage.recipient;
464
469
  console.log("(Tiledesk) Recipient_id: ", recipient_id);
465
470
 
@@ -586,7 +591,7 @@ router.post("/webhook/:project_id", async (req, res) => {
586
591
  console.log("File position: ", filename);
587
592
  if (!filename) {
588
593
  console.log("Unable to download media. Message not sent.");
589
- res.status(500).send({ success: false, error: "unable to download media" })
594
+ return res.status(500).send({ success: false, error: "unable to download media" })
590
595
  }
591
596
  let file_path = path.join(__dirname, 'tmp', filename);
592
597
 
@@ -604,7 +609,7 @@ router.post("/webhook/:project_id", async (req, res) => {
604
609
  console.log("File position: ", filename);
605
610
  if (!filename) {
606
611
  console.log("Unable to download media. Message not sent.");
607
- res.status(500).send({ success: false, error: "unable to download media" })
612
+ return res.status(500).send({ success: false, error: "unable to download media" })
608
613
  }
609
614
  let file_path = path.join(__dirname, 'tmp', filename);
610
615
 
@@ -622,7 +627,7 @@ router.post("/webhook/:project_id", async (req, res) => {
622
627
  console.log("File position: ", filename);
623
628
  if (!filename) {
624
629
  console.log("Unable to download media. Message not sent.");
625
- res.status(500).send({ success: false, error: "unable to download media" })
630
+ return res.status(500).send({ success: false, error: "unable to download media" })
626
631
  }
627
632
  let file_path = path.join(__dirname, 'tmp', filename);
628
633
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-whatsapp-connector",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "Tiledesk Whatsapp connector",
5
5
  "main": "index.js",
6
6
  "scripts": {