diff --git a/server/notification.js b/server/notification.js index f8dc67977..ad74082f0 100644 --- a/server/notification.js +++ b/server/notification.js @@ -56,6 +56,22 @@ class Notification { } else if (notification.type === "discord") { return await Notification.discord(notification, msg) + } else if (notification.type === "signal") { + try { + let data = { + "message": msg, + "number": notification.signalNumber, + "recipients": notification.signalRecipients.replace(/\s/g, '').split(",") + }; + let config = {}; + + let res = await axios.post(notification.signalURL, data, config) + return true; + } catch (error) { + console.log(error) + return false; + } + } else { throw new Error("Notification type is not supported") } diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index c86551616..5f1e32b1e 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -17,6 +17,7 @@ + @@ -44,9 +45,8 @@ Support Direct Chat / Group / Channel's Chat ID
- You can get your chat id by sending message to the bot and go to this url to view the chat_id: -
- + You can ge https://github.com/bbernhard/signal-cli-rest-api +
@@ -143,6 +143,41 @@
+
+
+ You can check this url to view how to setup one:
+
+ https://github.com/bbernhard/signal-cli-rest-api
+
+ IMPORTANT: You cannot mix groups and numbers in recipients!
+