From 91fde24388c97d5f74b1b68d5ada7f69725ab964 Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 13 Apr 2015 17:32:35 +0200 Subject: Display error messages inside a conversation if the error has the same id as a sent message, it will be displayed with a cross where there is usually a checkmark (ack), and the received error will be appended to the message, in red. if it does not have a know id, it will be added as another message to the conversation, without a nick, and in red. --- src/tabs/basetabs.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/tabs/basetabs.py') diff --git a/src/tabs/basetabs.py b/src/tabs/basetabs.py index 16752b5e..184a9243 100644 --- a/src/tabs/basetabs.py +++ b/src/tabs/basetabs.py @@ -747,6 +747,17 @@ class OneToOneTab(ChatTab): self.text_win.modify_message(msg_id, new_msg) self.core.refresh_window() + def nack_message(self, error, msg_id, msg_jid): + """ + Ack a message + """ + new_msg = self._text_buffer.nack_message(error, msg_id, msg_jid) + if new_msg: + self.text_win.modify_message(msg_id, new_msg) + self.core.refresh_window() + return True + return False + @command_args_parser.raw def command_xhtml(self, xhtml_data): message = self.generate_xhtml_message(xhtml_data) -- cgit v1.2.3