Commit 8495492c authored by mathieui's avatar mathieui

Fix #3193 (report PM errors in PM tab)

parent b00d2fd2
......@@ -220,10 +220,15 @@ class HandlerCore:
jid_from = message['from']
for tab in self.core.get_tabs(tabs.MucTab):
if tab.name == jid_from.bare:
if message['type'] == 'error':
if jid_from.full == jid_from.bare:
self.core.room_error(message, jid_from.bare)
else:
self.on_groupchat_private_message(message)
text = self.core.get_error_message(message)
p_tab = self.core.get_tab_by_name(jid_from.full, tabs.PrivateTab)
if p_tab:
p_tab.add_error(text)
else:
self.core.information(text, 'Error')
return
tab = self.core.get_conversation_by_jid(message['from'], create=False)
error_msg = self.core.get_error_message(message, deprecated=True)
......
......@@ -360,4 +360,10 @@ class PrivateTab(OneToOneTab):
def matching_names(self):
return [(3, safeJID(self.name).resource), (4, self.name)]
def add_error(self, error_message):
error = '\x19%s}%s\x19o' % (dump_tuple(get_theme().COLOR_CHAR_NACK),
error_message)
self.add_message(error, highlight=True, nickname='Error',
nick_color=get_theme().COLOR_ERROR_MSG, typ=2)
self.core.refresh_window()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment