fixes TB, that causes bug #613 and #612

This commit is contained in:
Dimitur Kirov 2005-07-26 07:22:08 +00:00
parent 07f52fce9c
commit a43aae3a26
1 changed files with 11 additions and 3 deletions

View File

@ -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):