aboutsummaryrefslogtreecommitdiff
path: root/vnext/server/middleware/event.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/server/middleware/event.js')
-rw-r--r--vnext/server/middleware/event.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/vnext/server/middleware/event.js b/vnext/server/middleware/event.js
index 5ea855dd..136ae268 100644
--- a/vnext/server/middleware/event.js
+++ b/vnext/server/middleware/event.js
@@ -4,6 +4,7 @@ import { sendTelegramNotification } from '../durov';
import { subscribers } from '../http';
import { sendNotification, buildNotification } from '../sender';
import debug from 'debug';
+import { send } from '../hms';
var log = debug('event');
/** @type {number[]} */
@@ -40,6 +41,11 @@ function processMessageEvent(msg) {
.filter(t => ['durov'].includes(t.type))
.map(t => t.token);
sendTelegramNotification(msg, durovIds);
+ let hmsIds = (user.tokens || [])
+ .filter(t => t.type === 'hcm')
+ .map(t => t.token);
+ log(`${user.uname}: ${hmsIds}`);
+ send(msg, hmsIds).then(() => {}).catch(log);
});
}).catch(log);
}