feat: #8204, separate notification type for group chats

This commit is contained in:
Barış Soner Uşaklı
2020-11-17 12:52:02 -05:00
parent 6e43086558
commit b44ddecdf8
6 changed files with 25 additions and 10 deletions

View File

@@ -57,8 +57,9 @@ module.exports = function (Messaging) {
return;
}
const isGroupChat = await Messaging.isGroupChat(roomId);
const notification = await notifications.create({
type: 'new-chat',
type: isGroupChat ? 'new-group-chat' : 'new-chat',
subject: '[[email:notif.chat.subject, ' + messageObj.fromUser.username + ']]',
bodyShort: '[[notifications:new_message_from, ' + messageObj.fromUser.username + ']]',
bodyLong: messageObj.content,