From 5795a2716298626a31a2b70a489e06671834d96b Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 6 Oct 2008 20:42:56 +0000 Subject: [PATCH] prevent traceback in case a groupchat comes in roster. fixes #4362 --- src/message_window.py | 5 ++++- src/roster_window.py | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/message_window.py b/src/message_window.py index 61d982e61..53d8dfa8b 100644 --- a/src/message_window.py +++ b/src/message_window.py @@ -1034,7 +1034,10 @@ class MessageWindowMgr(gobject.GObject): def get_gc_control(self, jid, acct): '''Same as get_control. Was briefly required, is not any more. May be useful some day in the future?''' - return self.get_control(jid, acct) + ctrl = self.get_control(jid, acct) + if ctrl.type_id == message_control.TYPE_GC: + return ctrl + return None def get_controls(self, type = None, acct = None): ctrls = [] diff --git a/src/roster_window.py b/src/roster_window.py index 0f8b0eb4e..a63d5461b 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -2075,8 +2075,9 @@ class RosterWindow: gajim.con_types[account] = None for jid in gajim.contacts.get_jid_list(account): lcontact = gajim.contacts.get_contacts(account, jid) - for contact in [c for c in lcontact if (c.show != 'offline' or - c.is_transport())]: + ctrl = gajim.interface.msg_win_mgr.get_gc_control(jid, account) + for contact in [c for c in lcontact if ((c.show != 'offline' or + c.is_transport()) and not ctrl)]: self.chg_contact_status(contact, 'offline', '', account) self.actions_menu_needs_rebuild = True self.update_status_combobox()