From 94c33e6bfe385dc1be4cdf24f82171371047bc54 Mon Sep 17 00:00:00 2001 From: stefanoverducci Date: Thu, 9 Nov 2017 11:58:34 +0000 Subject: [PATCH 1/2] fixed notification --- .../server/methods/jitsiSetTimeout.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js b/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js index 02aea743ab4b..72b89306894a 100644 --- a/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js +++ b/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js @@ -13,11 +13,20 @@ Meteor.methods({ if (jitsiTimeout <= currentTime) { RocketChat.models.Rooms.setJitsiTimeout(rid, new Date(currentTime + 35*1000)); - RocketChat.models.Messages.createWithTypeRoomIdMessageAndUser('jitsi_call_started', rid, '', Meteor.user(), { + const message = RocketChat.models.Messages.createWithTypeRoomIdMessageAndUser('jitsi_call_started', rid, '', Meteor.user(), { actionLinks : [ { icon: 'icon-videocam', label: TAPi18n.__('Click_to_join'), method_id: 'joinJitsiCall', params: ''} ] }); + const room = RocketChat.models.Rooms.findOneById(rid); + message.msg = TAPi18n.__('Started_a_video_call'); + message.mentions = [ + { + _id:'here', + username:'here' + } + ]; + RocketChat.callbacks.run('afterSaveMessage', message, room); } else if ((jitsiTimeout - currentTime) / 1000 <= 15) { RocketChat.models.Rooms.setJitsiTimeout(rid, new Date(jitsiTimeout + 25*1000)); } From 379feb2891271cd899d060e658a37a1f3c0cfdaa Mon Sep 17 00:00:00 2001 From: seainside75 Date: Fri, 10 Nov 2017 11:09:08 +0100 Subject: [PATCH 2/2] Fixed indentation --- .../server/methods/jitsiSetTimeout.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js b/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js index 72b89306894a..3deaf74e43d3 100644 --- a/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js +++ b/packages/rocketchat-videobridge/server/methods/jitsiSetTimeout.js @@ -21,11 +21,11 @@ Meteor.methods({ const room = RocketChat.models.Rooms.findOneById(rid); message.msg = TAPi18n.__('Started_a_video_call'); message.mentions = [ - { - _id:'here', - username:'here' - } - ]; + { + _id:'here', + username:'here' + } + ]; RocketChat.callbacks.run('afterSaveMessage', message, room); } else if ((jitsiTimeout - currentTime) / 1000 <= 15) { RocketChat.models.Rooms.setJitsiTimeout(rid, new Date(jitsiTimeout + 25*1000));