parent
07f52fce9c
commit
a43aae3a26
|
@ -79,6 +79,12 @@ def get_nick_from_fjid(jid):
|
||||||
# gaim@conference.jabber.org/nick/nick-continued
|
# gaim@conference.jabber.org/nick/nick-continued
|
||||||
return jid.split('/', 1)[1]
|
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):
|
def get_contact_instances_from_jid(account, jid):
|
||||||
''' we may have two or more resources on that jid '''
|
''' we may have two or more resources on that jid '''
|
||||||
if jid in contacts[account]:
|
if jid in contacts[account]:
|
||||||
|
@ -86,13 +92,15 @@ def get_contact_instances_from_jid(account, jid):
|
||||||
return contacts_instances
|
return contacts_instances
|
||||||
|
|
||||||
def get_first_contact_instance_from_jid(account, jid):
|
def get_first_contact_instance_from_jid(account, jid):
|
||||||
|
contact = None # if not found skip TB
|
||||||
if jid in contacts[account]:
|
if jid in contacts[account]:
|
||||||
contact = contacts[account][jid][0]
|
contact = contacts[account][jid][0]
|
||||||
else: # it's fake jid
|
else: # it's fake jid
|
||||||
#FIXME: problem see comment in next line
|
#FIXME: problem see comment in next line
|
||||||
nick = get_nick_from_fjid(jid) # if we ban/kick we now real jid
|
room, nick = \
|
||||||
if nick in gc_contacts[jid]:
|
get_room_and_nick_from_fjid(jid) # if we ban/kick we now real jid
|
||||||
contact = gc_contacts[jid][nick] # always only one instance
|
if nick in gc_contacts[account][room]:
|
||||||
|
contact = gc_contacts[account][room][nick]
|
||||||
return contact
|
return contact
|
||||||
|
|
||||||
def get_contact_name_from_jid(account, jid):
|
def get_contact_name_from_jid(account, jid):
|
||||||
|
|
Loading…
Reference in New Issue