From 0f9b37b8a8ee9ec469426f425a6415269653ac5a Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 30 Dec 2012 14:54:54 +0100 Subject: Do not rebuild everything in order to modify a message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (should fix the “leak” on /correct, and make it faster) --- src/tabs.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/tabs.py') diff --git a/src/tabs.py b/src/tabs.py index d9dae765..f4e224f7 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -1639,10 +1639,11 @@ class MucTab(ChatTab): def modify_message(self, txt, old_id, new_id, time=None, nickname=None): self.log_message(txt, time, nickname) highlight = self.do_highlight(txt, time, nickname) - self._text_buffer.modify_message(txt, old_id, new_id, highlight=highlight, time=time) - self.text_win.rebuild_everything(self._text_buffer) - self.core.refresh_window() - return highlight + message = self._text_buffer.modify_message(txt, old_id, new_id, highlight=highlight, time=time) + if message: + self.text_win.modify_message(old_id, message) + self.core.refresh_window() + return highlight def matching_names(self): return [safeJID(self.get_name()).user] -- cgit v1.2.3