From a43aae3a262bbe8d68eec9fc34418e05670d1d47 Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Tue, 26 Jul 2005 07:22:08 +0000 Subject: [PATCH] fixes TB, that causes bug #613 and #612 --- src/common/gajim.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/common/gajim.py b/src/common/gajim.py index 1519db0ed..c8186270d 100644 --- a/src/common/gajim.py +++ b/src/common/gajim.py @@ -78,6 +78,12 @@ def get_nick_from_fjid(jid): # fake jid is the jid for a contact in a room # gaim@conference.jabber.org/nick/nick-continued return jid.split('/', 1)[1] + +def get_room_and_nick_from_fjid(jid): + # fake jid is the jid for a contact in a room + # gaim@conference.jabber.org/nick/nick-continued + # return ('gaim@conference.jabber.org', 'nick/nick-continued') + return jid.split('/', 1) def get_contact_instances_from_jid(account, jid): ''' we may have two or more resources on that jid ''' @@ -86,13 +92,15 @@ def get_contact_instances_from_jid(account, jid): return contacts_instances def get_first_contact_instance_from_jid(account, jid): + contact = None # if not found skip TB if jid in contacts[account]: contact = contacts[account][jid][0] else: # it's fake jid #FIXME: problem see comment in next line - nick = get_nick_from_fjid(jid) # if we ban/kick we now real jid - if nick in gc_contacts[jid]: - contact = gc_contacts[jid][nick] # always only one instance + room, nick = \ + get_room_and_nick_from_fjid(jid) # if we ban/kick we now real jid + if nick in gc_contacts[account][room]: + contact = gc_contacts[account][room][nick] return contact def get_contact_name_from_jid(account, jid):