3 function generateNewChatNotifications(notificationType, notificationDetails /*, device*/) {
4 var room = notificationDetails.room;
5 var chats = notificationDetails.chats;
8 type: notificationType,
9 linkUrl: room.url + '?utm_source=web-push-notification',
13 name: room.name || room.uri,
14 oneToOne: room.oneToOne,
17 chats: chats.map(function(chat) {
23 username: chat.fromUser.username,
24 displayName: chat.fromUser.displayName,
25 avatarUrl: chat.fromUser.avatarUrl
38 function generateNotifications(notificationType, notificationDetails, device) {
39 switch (notificationType) {
41 return generateNewChatNotifications(notificationType, notificationDetails, device);
45 module.exports = generateNotifications;