|
|
@@ -202,7 +202,8 @@ ChatRoom.prototype.discoRoomInfo = function () {
|
|
202
|
202
|
.c('query', {xmlns: Strophe.NS.DISCO_INFO});
|
|
203
|
203
|
|
|
204
|
204
|
this.connection.sendIQ(getInfo, function (result) {
|
|
205
|
|
- var locked = $(result).find('>query>feature[var="muc_passwordprotected"]').length;
|
|
|
205
|
+ var locked = $(result).find('>query>feature[var="muc_passwordprotected"]')
|
|
|
206
|
+ .length === 1;
|
|
206
|
207
|
if (locked != this.locked) {
|
|
207
|
208
|
this.eventEmitter.emit(XMPPEvents.MUC_LOCK_CHANGED, locked);
|
|
208
|
209
|
this.locked = locked;
|
|
|
@@ -307,6 +308,11 @@ ChatRoom.prototype.onPresence = function (pres) {
|
|
307
|
308
|
var now = this.connectionTimes["muc.joined"] =
|
|
308
|
309
|
window.performance.now();
|
|
309
|
310
|
logger.log("(TIME) MUC joined:\t", now);
|
|
|
311
|
+
|
|
|
312
|
+ // set correct initial state of locked
|
|
|
313
|
+ if (this.password)
|
|
|
314
|
+ this.locked = true;
|
|
|
315
|
+
|
|
310
|
316
|
this.eventEmitter.emit(XMPPEvents.MUC_JOINED);
|
|
311
|
317
|
}
|
|
312
|
318
|
} else if (this.members[from] === undefined) {
|