From d64930662a2f5c8215e8128c6bfd7aafeca82fde Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Fri, 17 Feb 2023 09:21:32 +0100 Subject: [PATCH] Handle buffer cleared --- src/js/handlers.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/js/handlers.js b/src/js/handlers.js index 656d6cc..26cf523 100644 --- a/src/js/handlers.js +++ b/src/js/handlers.js @@ -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]; @@ -500,6 +507,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, @@ -541,4 +549,4 @@ weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', 'notific handleCompletion: handleCompletion }; -}]); \ No newline at end of file +}]);