diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2012-10-12 15:29:45 +0000 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2012-10-12 15:29:45 +0000 |
commit | 88da6869b4662520fe2181a69cbc9d96e50ea1de (patch) | |
tree | ef4bbdbab932caba94884761adb50d716e27e15e /src/tabs.py | |
parent | 2e8fc00f8b55537e6b4eb8a607afcc67fb27732d (diff) | |
download | poezio-88da6869b4662520fe2181a69cbc9d96e50ea1de.tar.gz poezio-88da6869b4662520fe2181a69cbc9d96e50ea1de.tar.bz2 poezio-88da6869b4662520fe2181a69cbc9d96e50ea1de.tar.xz poezio-88da6869b4662520fe2181a69cbc9d96e50ea1de.zip |
When a message is corrected, display it correctly in place of the previous one.
Diffstat (limited to 'src/tabs.py')
-rw-r--r-- | src/tabs.py | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/tabs.py b/src/tabs.py index 2895b784..beb98cc9 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -1564,7 +1564,11 @@ class MucTab(ChatTab): return user return None - def add_message(self, txt, time=None, nickname=None, forced_user=None, nick_color=None, history=None): + def modify_message(self, txt, old_id, new_id): + self._text_buffer.modify_message(txt, old_id, new_id) + self.core.refresh_window() + + def add_message(self, txt, time=None, nickname=None, forced_user=None, nick_color=None, history=None, identifier=None): """ Note that user can be None even if nickname is not None. It happens when we receive an history message said by someone who is not @@ -1591,7 +1595,7 @@ class MucTab(ChatTab): if highlight: nick_color = highlight time = time or datetime.now() - self._text_buffer.add_message(txt, time, nickname, nick_color, history, user, highlight=highlight) + self._text_buffer.add_message(txt, time, nickname, nick_color, history, user, highlight=highlight, identifier=identifier) return highlight class PrivateTab(ChatTab): @@ -1869,12 +1873,17 @@ class PrivateTab(ChatTab): if reason: self.add_message(txt=reason) - def add_message(self, txt, time=None, nickname=None, forced_user=None, nick_color=None): + def modify_message(self, txt, old_id, new_id): + self._text_buffer.modify_message(txt, old_id, new_id) + self.core.refresh_window() + + def add_message(self, txt, time=None, nickname=None, forced_user=None, nick_color=None, identifier=None): self._text_buffer.add_message(txt, time=time, nickname=nickname, nick_color=nick_color, history=None, - user=forced_user) + user=forced_user, + identifier=identifier) class RosterInfoTab(Tab): """ @@ -2958,12 +2967,17 @@ class ConversationTab(ChatTab): if config.get_by_tabname('send_chat_states', 'true', self.general_jid, True) == 'true': self.send_chat_state('gone') - def add_message(self, txt, time=None, nickname=None, forced_user=None, nick_color=None): + def modify_message(self, txt, old_id, new_id): + self._text_buffer.modify_message(txt, old_id, new_id) + self.core.refresh_window() + + def add_message(self, txt, time=None, nickname=None, forced_user=None, nick_color=None, identifier=None): self._text_buffer.add_message(txt, time=time, nickname=nickname, nick_color=nick_color, history=None, - user=forced_user) + user=forced_user, + identifier=identifier) class MucListTab(Tab): |