Browse Source

fix unseen count anon keysends

loopout2
Evan Feenstra 4 years ago
parent
commit
266ca416da
  1. 6
      dist/src/hub.js
  2. 2
      dist/src/hub.js.map
  3. 6
      src/hub.ts

6
dist/src/hub.js

@ -243,7 +243,11 @@ function finalNotification(ownerID, params) {
if (params.notification.message) {
console.log('[send notification]', params.notification);
}
let unseenMessages = yield models_1.models.Message.count({ where: { sender: { [sequelize_1.Op.ne]: ownerID }, seen: false } });
let unseenMessages = yield models_1.models.Message.count({ where: {
sender: { [sequelize_1.Op.ne]: ownerID },
seen: false,
chatId: { [sequelize_1.Op.ne]: 0 } // no anon keysends
} });
params.notification.badge = unseenMessages;
triggerNotification(params);
});

2
dist/src/hub.js.map

File diff suppressed because one or more lines are too long

6
src/hub.ts

@ -248,7 +248,11 @@ async function finalNotification(ownerID: number, params:{[k:string]:any}){
if(params.notification.message) {
console.log('[send notification]', params.notification)
}
let unseenMessages = await models.Message.count({ where: { sender: { [Op.ne]: ownerID }, seen: false } })
let unseenMessages = await models.Message.count({ where: {
sender: { [Op.ne]: ownerID },
seen: false,
chatId: { [Op.ne]: 0 } // no anon keysends
} })
params.notification.badge = unseenMessages
triggerNotification(params)
}

Loading…
Cancel
Save