Browse Source

fix if is muted

push-params
Evan Feenstra 5 years ago
parent
commit
b8213369c6
  1. 7
      api/hub.ts
  2. 7
      dist/api/hub.js
  3. 2
      dist/api/hub.js.map

7
api/hub.ts

@ -214,17 +214,14 @@ const sendNotification = async (chat, name, type:NotificationType) => {
}
const device_id = owner.deviceId
let unseenMessages=0
if(!chat.isMuted || type!=='invite') {
unseenMessages = await models.Message.count({ where: { sender: { [Op.ne]: owner.id }, seen: false } })
}
let unseenMessages=await models.Message.count({ where: { sender: { [Op.ne]: owner.id }, seen: false } })
const params:{[k:string]:any} = {device_id}
const notification:{[k:string]:any} = {
chat_id: chat.id,
badge: unseenMessages
}
if(type!=='badge') {
if(type!=='badge' && !chat.isMuted) {
notification.message = message
if(owner.notificationSound) {
notification.sound = owner.notificationSound

7
dist/api/hub.js

@ -205,16 +205,13 @@ const sendNotification = (chat, name, type) => __awaiter(void 0, void 0, void 0,
return;
}
const device_id = owner.deviceId;
let unseenMessages = 0;
if (!chat.isMuted || type !== 'invite') {
unseenMessages = yield models_1.models.Message.count({ where: { sender: { [sequelize_1.Op.ne]: owner.id }, seen: false } });
}
let unseenMessages = yield models_1.models.Message.count({ where: { sender: { [sequelize_1.Op.ne]: owner.id }, seen: false } });
const params = { device_id };
const notification = {
chat_id: chat.id,
badge: unseenMessages
};
if (type !== 'badge') {
if (type !== 'badge' && !chat.isMuted) {
notification.message = message;
if (owner.notificationSound) {
notification.sound = owner.notificationSound;

2
dist/api/hub.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save