parent
fff2783c1b
commit
fc6037af46
7 changed files with 36 additions and 4 deletions
|
|
@ -268,6 +268,24 @@ async function composeNotification(data: PushNotificationDataMap[keyof PushNotif
|
|||
data,
|
||||
renotify: true,
|
||||
}];
|
||||
case 'newChatMessage':
|
||||
if (data.body.toRoom != null) {
|
||||
return [`${data.body.toRoom.name}: ${getUserName(data.body.fromUser)}: ${data.body.text}`, {
|
||||
icon: data.body.fromUser.avatarUrl,
|
||||
badge: iconUrl('messages'),
|
||||
tag: `chat:room:${data.body.toRoomId}`,
|
||||
data,
|
||||
renotify: true,
|
||||
}];
|
||||
} else {
|
||||
return [`${getUserName(data.body.fromUser)}: ${data.body.text}`, {
|
||||
icon: data.body.fromUser.avatarUrl,
|
||||
badge: iconUrl('messages'),
|
||||
tag: `chat:user:${data.body.fromUserId}`,
|
||||
data,
|
||||
renotify: true,
|
||||
}];
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue