From ae394408e62eb5817679998a4b7a249b9d627901 Mon Sep 17 00:00:00 2001 From: isymchych Date: Fri, 18 Dec 2015 15:58:40 +0200 Subject: [PATCH] remove old nick when adding new one --- JitsiConference.js | 3 +++ lib-jitsi-meet.js | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/JitsiConference.js b/JitsiConference.js index 4cdd5cda3..c57d404ab 100644 --- a/JitsiConference.js +++ b/JitsiConference.js @@ -211,6 +211,9 @@ JitsiConference.prototype.removeCommand = function (name) { */ JitsiConference.prototype.setDisplayName = function(name) { if(this.room){ + // remove previously set nickname + this.room.removeFromPresence("nick"); + this.room.addToPresence("nick", {attributes: {xmlns: 'http://jabber.org/protocol/nick'}, value: name}); this.room.sendPresence(); } diff --git a/lib-jitsi-meet.js b/lib-jitsi-meet.js index 74c16fd7a..79038348f 100644 --- a/lib-jitsi-meet.js +++ b/lib-jitsi-meet.js @@ -213,6 +213,9 @@ JitsiConference.prototype.removeCommand = function (name) { */ JitsiConference.prototype.setDisplayName = function(name) { if(this.room){ + // remove previously set nickname + this.room.removeFromPresence("nick"); + this.room.addToPresence("nick", {attributes: {xmlns: 'http://jabber.org/protocol/nick'}, value: name}); this.room.sendPresence(); } @@ -959,9 +962,18 @@ var LibJitsiMeet = { return tracks; }); }, + /** + * Checks if its possible to enumerate available cameras/micropones. + * @returns {boolean} true if available, false otherwise. + */ isDeviceListAvailable: function () { return RTC.isDeviceListAvailable(); }, + /** + * Returns true if changing the camera / microphone device is supported and + * false if not. + * @returns {boolean} true if available, false otherwise. + */ isDeviceChangeAvailable: function () { return RTC.isDeviceChangeAvailable(); },