Merge pull request #1246 from torhve/handlebuffercleared

Handle buffer cleared
This commit is contained in:
Lorenz Hübschle 2023-03-25 19:07:53 +01:00 committed by GitHub
commit faa515aa07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -35,6 +35,13 @@ weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', 'notific
}
}
};
const handleBufferCleared = function(message) {
var bufferMessage = message.objects[0].content[0];
var bufferId = bufferMessage.pointers[0];
let buffer = models.getBuffer(bufferId);
$log.debug('Handle buffer cleared: ' + buffer.fullName);
buffer.clear();
};
var handleBufferClosing = function(message) {
var bufferMessage = message.objects[0].content[0];
@ -501,6 +508,7 @@ weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', 'notific
};
var eventHandlers = {
_buffer_cleared: handleBufferCleared,
_buffer_closing: handleBufferClosing,
_buffer_line_added: handleBufferLineAdded,
_buffer_localvar_added: handleBufferLocalvarChanged,
@ -542,4 +550,4 @@ weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', 'notific
handleCompletion: handleCompletion
};
}]);
}]);