[FIX] Livechat not sending desktop notifications (#11266)
parent
830607da64
commit
22d1caeb24
@ -0,0 +1,3 @@ |
||||
import LivechatRoomType from '../imports/LivechatRoomType'; |
||||
|
||||
RocketChat.roomTypes.add(new LivechatRoomType()); |
@ -0,0 +1,25 @@ |
||||
import LivechatRoomType from '../imports/LivechatRoomType'; |
||||
import LivechatVisitors from './models/LivechatVisitors'; |
||||
|
||||
class LivechatRoomTypeServer extends LivechatRoomType { |
||||
getMsgSender(senderId) { |
||||
return LivechatVisitors.findOneById(senderId); |
||||
} |
||||
|
||||
/** |
||||
* Returns details to use on notifications |
||||
* |
||||
* @param {object} room |
||||
* @param {object} user |
||||
* @param {string} notificationMessage |
||||
* @return {object} Notification details |
||||
*/ |
||||
getNotificationDetails(room, user, notificationMessage) { |
||||
const title = `[livechat] ${ this.roomName(room) }`; |
||||
const text = notificationMessage; |
||||
|
||||
return { title, text }; |
||||
} |
||||
} |
||||
|
||||
RocketChat.roomTypes.add(new LivechatRoomTypeServer()); |
Loading…
Reference in new issue