|
|
@ -59,7 +59,6 @@ module.exports = function (Messaging) {
|
|
|
|
async function sendNotifications(fromuid, uids, roomId, messageObj) {
|
|
|
|
async function sendNotifications(fromuid, uids, roomId, messageObj) {
|
|
|
|
const hasRead = await Messaging.hasRead(uids, roomId);
|
|
|
|
const hasRead = await Messaging.hasRead(uids, roomId);
|
|
|
|
uids = uids.filter((uid, index) => !hasRead[index] && parseInt(fromuid, 10) !== parseInt(uid, 10));
|
|
|
|
uids = uids.filter((uid, index) => !hasRead[index] && parseInt(fromuid, 10) !== parseInt(uid, 10));
|
|
|
|
console.log('checking notif', uids, hasRead);
|
|
|
|
|
|
|
|
if (!uids.length) {
|
|
|
|
if (!uids.length) {
|
|
|
|
delete Messaging.notifyQueue[`${fromuid}:${roomId}`];
|
|
|
|
delete Messaging.notifyQueue[`${fromuid}:${roomId}`];
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|