From 9786592b80f7ddcfefa967ea910f38ba3c02b0b4 Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 8 May 2014 00:27:26 +0200 Subject: Fix a hidden traceback on error message outside MUCs --- src/core/handlers.py | 3 ++- src/tabs/basetabs.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/handlers.py b/src/core/handlers.py index ce54ccab..4ec56a0b 100644 --- a/src/core/handlers.py +++ b/src/core/handlers.py @@ -1021,7 +1021,8 @@ def room_error(self, error, room_name): """ tab = self.get_tab_by_name(room_name) error_message = self.get_error_message(error) - tab.add_message(error_message, highlight=True, nickname='Error', nick_color=get_theme().COLOR_ERROR_MSG, typ=2) + tab.add_message(error_message, highlight=True, nickname='Error', + nick_color=get_theme().COLOR_ERROR_MSG, typ=2) code = error['error']['code'] if code == '401': msg = _('To provide a password in order to join the room, type "/join / password" (replace "password" by the real password)') diff --git a/src/tabs/basetabs.py b/src/tabs/basetabs.py index c1281e62..c472bd60 100644 --- a/src/tabs/basetabs.py +++ b/src/tabs/basetabs.py @@ -490,10 +490,13 @@ class ChatTab(Tab): if not logger.log_message(name, nickname, txt, date=time, typ=typ): self.core.information(_('Unable to write in the log file'), 'Error') - def add_message(self, txt, time=None, nickname=None, forced_user=None, nick_color=None, identifier=None, jid=None, history=None, typ=1): + def add_message(self, txt, time=None, nickname=None, forced_user=None, + nick_color=None, identifier=None, jid=None, history=None, + typ=1, highlight=False): self.log_message(txt, nickname, time=time, typ=typ) self._text_buffer.add_message(txt, time=time, nickname=nickname, + highlight=highlight, nick_color=nick_color, history=history, user=forced_user, -- cgit v1.2.3