diff --git a/converse.js b/converse.js index 04ba0362e..00ddcab52 100644 --- a/converse.js +++ b/converse.js @@ -1789,6 +1789,39 @@ $('input#show-rooms').show().siblings('span.spinner').remove(); }, + onRoomsFound: function (iq) { + /* Handle the IQ stanza returned from the server, containing + * all its public rooms. + */ + var name, jid, i, fragment, + that = this, + $available_chatrooms = this.$el.find('#available-chatrooms'); + this.rooms = $(iq).find('query').find('item'); + if (this.rooms.length) { + // # For translators: %1$s is a variable and will be + // # replaced with the XMPP server name + $available_chatrooms.html('
'+__('Rooms on %1$s',this.model.get('muc_domain'))+'
'); + fragment = document.createDocumentFragment(); + for (i=0; i'+__('Rooms on %1$s',this.model.get('muc_domain'))+''); - fragment = document.createDocumentFragment(); - for (i=0; i