From 26ca0c7076d2d4ef6c277ac9957ce632baef5a2b Mon Sep 17 00:00:00 2001 From: isymchych Date: Wed, 13 Jan 2016 18:34:58 +0200 Subject: [PATCH] handle USER_STATUS_CHANGED event --- conference.js | 4 ++++ modules/UI/UI.js | 7 +++---- modules/UI/videolayout/VideoLayout.js | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/conference.js b/conference.js index eee1b5816..92793ac7b 100644 --- a/conference.js +++ b/conference.js @@ -494,6 +494,10 @@ export default { APP.UI.updateRecordingState(status); }); + room.on(ConferenceEvents.USER_STATUS_CHANGED, function (id, status) { + APP.UI.updateUserStatus(id, status); + }); + room.on(ConferenceEvents.KICKED, () => { APP.UI.notifyKicked(); // FIXME close diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 70dd4b1c9..fd49dd641 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -425,10 +425,9 @@ UI.removeUser = function (id, displayName) { VideoLayout.removeParticipantContainer(id); }; -//FIXME: NOT USED. Should start using the lib -// function onMucPresenceStatus(jid, info) { -// VideoLayout.setPresenceStatus(Strophe.getResourceFromJid(jid), info.status); -// } +UI.updateUserStatus = function (id, status) { + VideoLayout.setPresenceStatus(id, status); +}; UI.onPeerVideoTypeChanged = (id, newVideoType) => { VideoLayout.onVideoTypeChanged(id, newVideoType); diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js index f460f2647..57510511b 100644 --- a/modules/UI/videolayout/VideoLayout.js +++ b/modules/UI/videolayout/VideoLayout.js @@ -387,8 +387,8 @@ var VideoLayout = { /** * Shows the presence status message for the given video. */ - setPresenceStatus (resourceJid, statusMsg) { - remoteVideos[resourceJid].setPresenceStatus(statusMsg); + setPresenceStatus (id, statusMsg) { + remoteVideos[id].setPresenceStatus(statusMsg); }, /**