diff options
author | mathieui <mathieui@mathieui.net> | 2015-04-13 17:32:35 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2015-04-13 17:35:40 +0200 |
commit | 91fde24388c97d5f74b1b68d5ada7f69725ab964 (patch) | |
tree | 340a64563b9ce98f26d26e817200da325e2f146f /src/core | |
parent | 1c9257b4a28e88c7f575e70939367fc9175ad53c (diff) | |
download | poezio-91fde24388c97d5f74b1b68d5ada7f69725ab964.tar.gz poezio-91fde24388c97d5f74b1b68d5ada7f69725ab964.tar.bz2 poezio-91fde24388c97d5f74b1b68d5ada7f69725ab964.tar.xz poezio-91fde24388c97d5f74b1b68d5ada7f69725ab964.zip |
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.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/handlers.py | 11 |
1 files changed, 10 insertions, 1 deletions
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): """ |