summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-12-30 14:54:54 +0100
committermathieui <mathieui@mathieui.net>2012-12-30 14:54:54 +0100
commit0f9b37b8a8ee9ec469426f425a6415269653ac5a (patch)
tree1c36fa9e180af62d8c79060ed1ec2340f3926324 /src/tabs.py
parent1313e7be3800d330824e1a8021e78bba5ddffe45 (diff)
downloadpoezio-0f9b37b8a8ee9ec469426f425a6415269653ac5a.tar.gz
poezio-0f9b37b8a8ee9ec469426f425a6415269653ac5a.tar.bz2
poezio-0f9b37b8a8ee9ec469426f425a6415269653ac5a.tar.xz
poezio-0f9b37b8a8ee9ec469426f425a6415269653ac5a.zip
Do not rebuild everything in order to modify a message
(should fix the “leak” on /correct, and make it faster)
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py9
1 files changed, 5 insertions, 4 deletions
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]