support for "read" pushes

This commit is contained in:
or-else
2022-03-03 17:47:32 -08:00
parent 470d38e583
commit c6a9df9fe9
6 changed files with 51 additions and 21 deletions
+15 -2
View File
@@ -7643,8 +7643,21 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
}
handlePushMessage(data) {
if (data.what == 'msg' && tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().isChannelTopicName(data.topic)) {
this.tinode.oobNotification(data.topic, data.seq, 'fake-uid');
switch (data.what) {
case 'msg':
if (tinode_sdk__WEBPACK_IMPORTED_MODULE_4___default().isChannelTopicName(data.topic)) {
this.tinode.oobNotification('msg', data.topic, data.seq, 'fake-uid');
}
break;
case 'read':
console.log("Message read on another device", data.seq);
this.tinode.oobNotification('read', data.topic, data.seq);
break;
default:
console.warn("Unknown push type ignored", data.what, data);
}
}