|
@@ -88,6 +88,8 @@ function ChatRoom(connection, jid, password, XMPP, options, settings) {
|
88
|
88
|
this.phonePin = null;
|
89
|
89
|
this.connectionTimes = {};
|
90
|
90
|
this.participantPropertyListener = null;
|
|
91
|
+
|
|
92
|
+ this.locked = false;
|
91
|
93
|
}
|
92
|
94
|
|
93
|
95
|
ChatRoom.prototype.initPresenceMap = function () {
|
|
@@ -193,6 +195,24 @@ ChatRoom.prototype.doLeave = function () {
|
193
|
195
|
this.connection.flush();
|
194
|
196
|
};
|
195
|
197
|
|
|
198
|
+ChatRoom.prototype.discoRoomInfo = function () {
|
|
199
|
+ // https://xmpp.org/extensions/xep-0045.html#disco-roominfo
|
|
200
|
+
|
|
201
|
+ var getInfo = $iq({type: 'get', to: this.roomjid})
|
|
202
|
+ .c('query', {xmlns: Strophe.NS.DISCO_INFO});
|
|
203
|
+
|
|
204
|
+ this.connection.sendIQ(getInfo, (result) => {
|
|
205
|
+ var locked = $(result).find('>query>feature[var="muc_passwordprotected"]').length;
|
|
206
|
+ if (locked != this.locked) {
|
|
207
|
+ this.eventEmitter.emit(XMPPEvents.MUC_LOCK_CHANGED, locked);
|
|
208
|
+ this.locked = locked;
|
|
209
|
+ }
|
|
210
|
+ }, (error) => {
|
|
211
|
+ GlobalOnErrorHandler.callErrorHandler(error);
|
|
212
|
+ logger.error("Error getting room info: ", error);
|
|
213
|
+ });
|
|
214
|
+};
|
|
215
|
+
|
196
|
216
|
|
197
|
217
|
ChatRoom.prototype.createNonAnonymousRoom = function () {
|
198
|
218
|
// http://xmpp.org/extensions/xep-0045.html#createroom-reserved
|
|
@@ -536,6 +556,10 @@ ChatRoom.prototype.onMessage = function (msg, from) {
|
536
|
556
|
}
|
537
|
557
|
}
|
538
|
558
|
|
|
559
|
+ if (from==this.myroomjid && $(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="104"]').length) {
|
|
560
|
+ this.discoRoomInfo();
|
|
561
|
+ }
|
|
562
|
+
|
539
|
563
|
if (txt) {
|
540
|
564
|
logger.log('chat', nick, txt);
|
541
|
565
|
this.eventEmitter.emit(XMPPEvents.MESSAGE_RECEIVED,
|