Skip to content
Snippets Groups Projects
Commit 6127f237 authored by nkour's avatar nkour
Browse files

comment get_real_jid_from_fjid to assure future protection from refactoring...

comment get_real_jid_from_fjid to assure future protection from refactoring and add docstring to get return values without reading the code. Both are importnat for such api funcs
parent 467ff431
No related branches found
No related tags found
No related merge requests found
......@@ -127,14 +127,17 @@ def get_room_and_nick_from_fjid(jid):
return l
def get_real_jid_from_fjid(account, fjid):
'''returns real jid, it returns None
if we don't know the real jid'''
room_jid, nick = get_room_and_nick_from_fjid(fjid)
if not nick: # It's not a fake_jid, so it's not pm
return fjid
if not nick: # It's not a fake_jid, it is a real jid
return fjid # we are mods for example so we know the real jid
real_jid = fjid
gcs = interface.windows[account]['gc']
if gcs.has_key(room_jid):
# It's a pm, so if we have real jid it's in contact.jid
contact = gc_contacts[account][room_jid][nick]
# contact.jid is None when it's not a real jid (we don't know real jid)
real_jid = contact.jid
return real_jid
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment