Commit b3ed43c4 authored by JC Brand's avatar JC Brand

Don't fetch rooms on roster or when leaving a room

Inefficient, causes way too much traffic and takes very long
parent df7f1ccf
...@@ -8,7 +8,7 @@ img.spinner { ...@@ -8,7 +8,7 @@ img.spinner {
box-shadow: none; box-shadow: none;
-moz-box-shadow: none; -moz-box-shadow: none;
-webkit-box-shadow: none; -webkit-box-shadow: none;
margin: 5px; margin: 0;
padding: 0 5px 0 5px; padding: 0 5px 0 5px;
} }
......
...@@ -750,12 +750,14 @@ ...@@ -750,12 +750,14 @@
}, this)); }, this));
} else { } else {
$available_chatrooms.html('<dt>No rooms on '+this.muc_domain+'</dt>'); $available_chatrooms.html('<dt>No rooms on '+this.muc_domain+'</dt>');
$('input#show-rooms').show().siblings('img.spinner').remove();
} }
return true; return true;
}, this), }, this),
$.proxy(function (iq) { // Failure $.proxy(function (iq) { // Failure
var $available_chatrooms = this.$el.find('#available-chatrooms'); var $available_chatrooms = this.$el.find('#available-chatrooms');
$available_chatrooms.html('<dt>No rooms on '+this.muc_domain+'</dt>'); $available_chatrooms.html('<dt>No rooms on '+this.muc_domain+'</dt>');
$('input#show-rooms').show().siblings('img.spinner').remove();
}, this)); }, this));
}, },
...@@ -985,7 +987,6 @@ ...@@ -985,7 +987,6 @@
$.proxy(this.onChatRoomPresence, this), $.proxy(this.onChatRoomPresence, this),
$.proxy(this.onChatRoomRoster, this)); $.proxy(this.onChatRoomRoster, this));
this.model.messages.on('add', this.showMessage, this); this.model.messages.on('add', this.showMessage, this);
this.model.on('destroy', function (model, response, options) { this.model.on('destroy', function (model, response, options) {
this.$el.hide('fast'); this.$el.hide('fast');
...@@ -1000,12 +1001,7 @@ ...@@ -1000,12 +1001,7 @@
this.render().show().model.messages.fetch({add: true}); this.render().show().model.messages.fetch({add: true});
}, },
onLeave: function () { onLeave: function () {},
var controlboxview = converse.chatboxesview.views.controlbox;
if (controlboxview) {
controlboxview.roomspanel.trigger('update-rooms-list');
}
},
onChatRoomPresence: function (presence, room) { onChatRoomPresence: function (presence, room) {
var nick = room.nick, var nick = room.nick,
...@@ -1113,9 +1109,6 @@ ...@@ -1113,9 +1109,6 @@
$participant_list = this.$el.find('.participant-list'), $participant_list = this.$el.find('.participant-list'),
participants = [], participants = [],
i; i;
if (controlboxview) {
controlboxview.roomspanel.trigger('update-rooms-list');
}
this.$el.find('.participant-list').empty(); this.$el.find('.participant-list').empty();
for (i=0; i<roster_size; i++) { for (i=0; i<roster_size; i++) {
participants.push('<li>' + Strophe.unescapeNode(_.keys(roster)[i]) + '</li>'); participants.push('<li>' + Strophe.unescapeNode(_.keys(roster)[i]) + '</li>');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment