introducing get_our_jids()

This commit is contained in:
Nikos Kouremenos 2006-02-26 14:13:13 +00:00
parent f674babbd1
commit db6f6151a1
1 changed files with 8 additions and 0 deletions

View File

@ -250,11 +250,19 @@ def jid_is_transport(jid):
return is_transport
def get_jid_from_account(account_name):
'''return the jid we use in the given account'''
name = config.get_per('accounts', account_name, 'name')
hostname = config.get_per('accounts', account_name, 'hostname')
jid = name + '@' + hostname
return jid
def get_our_jids():
'''returns a list of the jids we use in our accounts'''
our_jids = list()
for account in contacts.get_accounts():
our_jids.append(get_jid_from_account(account))
return our_jids
def get_hostname_from_account(account_name, use_srv = False):
'''returns hostname (if custom hostname is used, that is returned)'''
if use_srv and connections[account_name].connected_hostname: