diff --git a/src/common/connection.py b/src/common/connection.py index f6c6a0c3e..5a7a5707b 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -467,6 +467,13 @@ class Connection: i += 1 self.dispatch('GC_CONFIG', (str(iq_obj.getFrom()), dic)) + def _MucErrorCB(self, con, iq_obj): + gajim.log.debug('MucErrorCB') + jid = str(iq_obj.getFrom()) + errmsg = iq_obj.getError() + errcode = iq_obj.getErrorCode() + self.dispatch('MSGERROR', (jid, errcode, errmsg)) + def connect(self): """Connect and authentificate to the Jabber server""" name = gajim.config.get_per('accounts', self.name, 'name') @@ -513,6 +520,8 @@ class Connection: common.jabber.NS_VERSION) con.registerHandler('iq',self._MucOwnerCB,'result', \ common.jabber.NS_P_MUC_OWNER) + con.registerHandler('iq',self._MucErrorCB,'error',\ + common.jabber.NS_P_MUC_OWNER) try: con.connect() except: diff --git a/src/gajim.py b/src/gajim.py index 74fd7b200..449c11fae 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -298,12 +298,12 @@ class Interface: self.play_sound('next_message_received') def handle_event_msgerror(self, account, array): - #('MSGERROR', account, (user, error_code, error_msg, msg, time)) + #('MSGERROR', account, (jid, error_code, error_msg, msg, time)) jid = array[0].split('/')[0] if jid in self.windows[account]['gc']: self.windows[account]['gc'][jid].print_conversation('Error %s: %s' % \ - (array[1], array[2]), jid, tim = array[4]) - if self.windows[account]['gc'][jid].get_active() == jid: + (array[1], array[2]), jid) + if self.windows[account]['gc'][jid].get_active_jid() == jid: self.windows[account]['gc'][jid].set_subject(jid, \ self.windows[account]['gc'][jid].subjects[jid]) return