mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
prevent double join. fix affiliation typo
This commit is contained in:
9
muc.js
9
muc.js
@@ -7,6 +7,7 @@ Strophe.addConnectionPlugin('emuc', {
|
||||
roomjid: null,
|
||||
myroomjid: null,
|
||||
members: {},
|
||||
joined: false,
|
||||
isOwner: false,
|
||||
init: function (conn) {
|
||||
this.connection = conn;
|
||||
@@ -47,10 +48,14 @@ Strophe.addConnectionPlugin('emuc', {
|
||||
member.show = $(pres).find('>show').text();
|
||||
member.status = $(pres).find('>status').text();
|
||||
var tmp = $(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>item');
|
||||
member.affilication = tmp.attr('affiliation');
|
||||
member.affiliation = tmp.attr('affiliation');
|
||||
member.role = tmp.attr('role');
|
||||
if (from == this.myroomjid) {
|
||||
$(document).trigger('joined.muc', [from, member]);
|
||||
if (member.affiliation == 'owner') this.isOwner = true;
|
||||
if (!this.joined) {
|
||||
this.joined = true;
|
||||
$(document).trigger('joined.muc', [from, member]);
|
||||
}
|
||||
} else if (this.members[from] === undefined) {
|
||||
// new participant
|
||||
this.members[from] = member;
|
||||
|
||||
Reference in New Issue
Block a user