parent
07f52fce9c
commit
a43aae3a26
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue