Refactor to no longer call muc.listRooms. updates #307
This commit is contained in:
parent
79a5121219
commit
c7d5b8b13f
18
converse.js
18
converse.js
@ -1790,9 +1790,16 @@
|
||||
},
|
||||
|
||||
updateRoomsList: function () {
|
||||
converse.connection.muc.listRooms(
|
||||
this.model.get('muc_domain'),
|
||||
$.proxy(function (iq) { // Success
|
||||
/* Send and IQ stanza to the server asking for all rooms
|
||||
*/
|
||||
converse.connection.sendIQ(
|
||||
$iq({
|
||||
to: this.model.get('muc_domain'),
|
||||
from: converse.connection.jid,
|
||||
type: "get"
|
||||
}).c("query", {xmlns: Strophe.NS.DISCO_ITEMS}),
|
||||
// Succcess Handler
|
||||
$.proxy(function (iq) {
|
||||
var name, jid, i, fragment,
|
||||
that = this,
|
||||
$available_chatrooms = this.$el.find('#available-chatrooms');
|
||||
@ -1821,9 +1828,8 @@
|
||||
}
|
||||
return true;
|
||||
}, this),
|
||||
$.proxy(function (iq) { // Failure
|
||||
this.informNoRoomsFound();
|
||||
}, this));
|
||||
// Error handler
|
||||
$.proxy(function (iq) { this.informNoRoomsFound(); }, this));
|
||||
},
|
||||
|
||||
showRooms: function (ev) {
|
||||
|
@ -1112,6 +1112,12 @@
|
||||
expect($('.chatroom:visible').length).toBe(1); // There should now be an open chatroom
|
||||
}, converse));
|
||||
}, converse));
|
||||
|
||||
it("lists rooms currently on the server", $.proxy(function () {
|
||||
// TODO: test updateRoomsList
|
||||
// See: http://xmpp.org/extensions/xep-0045.html#disco-rooms
|
||||
}, converse));
|
||||
|
||||
}, converse));
|
||||
}, converse, mock, test_utils));
|
||||
}));
|
||||
|
Loading…
Reference in New Issue
Block a user