diff options
author | Joas Schilling <coding@schilljs.com> | 2022-01-13 21:21:59 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-01-13 21:40:27 +0300 |
commit | 79455819db19ae1c01ca5b471441e345a23a53ed (patch) | |
tree | d9e3bf166306613eb961e1c21b01211ca9a9c98e /src/utils/signaling.js | |
parent | 9221a7981fb43be34af1becf29bd62924adbc4d5 (diff) |
Don't update the participant list when only you joined
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'src/utils/signaling.js')
-rw-r--r-- | src/utils/signaling.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/utils/signaling.js b/src/utils/signaling.js index 9a6585bcf..a9231d88c 100644 --- a/src/utils/signaling.js +++ b/src/utils/signaling.js @@ -1166,6 +1166,8 @@ Signaling.Standalone.prototype.processRoomEvent = function(data) { // may now no longer exist. leftUsers = Object.assign({}, this.joinedUsers) } + + let userListIsDirty = false for (i = 0; i < joinedUsers.length; i++) { this.joinedUsers[joinedUsers[i].sessionid] = true delete leftUsers[joinedUsers[i].sessionid] @@ -1176,6 +1178,8 @@ Signaling.Standalone.prototype.processRoomEvent = function(data) { // as otherwise you get the warning for your own old session immediately this.ownSessionJoined = true } + } else { + userListIsDirty = true } } leftUsers = Object.keys(leftUsers) @@ -1184,10 +1188,16 @@ Signaling.Standalone.prototype.processRoomEvent = function(data) { for (i = 0; i < leftUsers.length; i++) { delete this.joinedUsers[leftUsers[i]] + + if (!this.settings.userId || leftUsers[i].userid !== this.settings.userId) { + userListIsDirty = true + } } } this._trigger('usersJoined', [joinedUsers]) - this._trigger('participantListChanged') + if (userListIsDirty) { + this._trigger('participantListChanged') + } } break case 'leave': |