Merge pull request #231 from lorenzhs/nicklistupdates

Ignore nicklist updates for buffers without a nicklist
This commit is contained in:
David Cormier 2014-03-10 14:23:06 -04:00
commit d27d3b415d

View file

@ -49,14 +49,19 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
* Adds a nick to nicklist * Adds a nick to nicklist
*/ */
var addNick = function(group, nick) { var addNick = function(group, nick) {
if (nicklistRequested()) {
nicklist[group].nicks.push(nick); nicklist[group].nicks.push(nick);
flatnicklist = getFlatNicklist(); flatnicklist = getFlatNicklist();
}
}; };
/* /*
* Deletes a nick from nicklist * Deletes a nick from nicklist
*/ */
var delNick = function(group, nick) { var delNick = function(group, nick) {
group = nicklist[group]; group = nicklist[group];
if (group === undefined) {
return;
}
group.nicks = _.filter(group.nicks, function(n) { return n.name !== nick.name;}); group.nicks = _.filter(group.nicks, function(n) { return n.name !== nick.name;});
flatnicklist = getFlatNicklist(); flatnicklist = getFlatNicklist();
/* /*