|
@@ -7,6 +7,7 @@ Strophe.addConnectionPlugin('emuc', {
|
7
|
7
|
roomjid: null,
|
8
|
8
|
myroomjid: null,
|
9
|
9
|
members: {},
|
|
10
|
+ joined: false,
|
10
|
11
|
isOwner: false,
|
11
|
12
|
init: function (conn) {
|
12
|
13
|
this.connection = conn;
|
|
@@ -47,10 +48,14 @@ Strophe.addConnectionPlugin('emuc', {
|
47
|
48
|
member.show = $(pres).find('>show').text();
|
48
|
49
|
member.status = $(pres).find('>status').text();
|
49
|
50
|
var tmp = $(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>item');
|
50
|
|
- member.affilication = tmp.attr('affiliation');
|
|
51
|
+ member.affiliation = tmp.attr('affiliation');
|
51
|
52
|
member.role = tmp.attr('role');
|
52
|
53
|
if (from == this.myroomjid) {
|
53
|
|
- $(document).trigger('joined.muc', [from, member]);
|
|
54
|
+ if (member.affiliation == 'owner') this.isOwner = true;
|
|
55
|
+ if (!this.joined) {
|
|
56
|
+ this.joined = true;
|
|
57
|
+ $(document).trigger('joined.muc', [from, member]);
|
|
58
|
+ }
|
54
|
59
|
} else if (this.members[from] === undefined) {
|
55
|
60
|
// new participant
|
56
|
61
|
this.members[from] = member;
|