Merge pull request #150 from lorenzhs/patch-2

switchToActivityBuffer: Prioritise notifications
This commit is contained in:
David Cormier 2014-02-17 08:46:58 -05:00
commit 6f972261da
1 changed files with 8 additions and 3 deletions

View File

@ -733,12 +733,17 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$rootScope.switchToActivityBuffer = function() {
// Find next buffer with activity and switch to it
var sortedBuffers = _.sortBy($scope.buffers, 'number');
for (var i in sortedBuffers) {
var buffer = sortedBuffers[i];
var i, buffer;
for (i in sortedBuffers) {
buffer = sortedBuffers[i];
if (buffer.notification > 0) {
$scope.setActiveBuffer(buffer.id);
break;
} else if(buffer.unread > 0) {
}
}
for (i in sortedBuffers) {
buffer = sortedBuffers[i];
if(buffer.unread > 0) {
$scope.setActiveBuffer(buffer.id);
break;
}