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/core/handlers.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/handlers.py b/src/core/handlers.py index a28e7410..3a5e9ea1 100644 --- a/src/core/handlers.py +++ b/src/core/handlers.py @@ -237,7 +237,16 @@ def on_error_message(self, message): return self.room_error(message, jid_from) else: return self.on_groupchat_private_message(message) - return self.information(self.get_error_message(message, deprecated=True), 'Error') + tab = self.get_conversation_by_jid(message['from'], create=False) + error_msg = self.get_error_message(message, deprecated=True) + if not tab: + return self.information(error_msg, _('Error')) + error = '\x19%s}%s\x19o' % (dump_tuple(get_theme().COLOR_CHAR_NACK), + error_msg) + if not tab.nack_message('\n' + error, message['id'], message['to']): + tab.add_message(error, typ=0) + self.refresh_window() + def on_normal_message(self, message): """ -- cgit v1.2.3