Provide method to get the account name from a jid

This commit is contained in:
Philipp Hörist 2018-05-10 10:53:56 +02:00
parent 2bb5d55c03
commit 093ba8dd97
1 changed files with 5 additions and 0 deletions

View File

@ -483,6 +483,11 @@ def get_jid_from_account(account_name):
jid = name + '@' + hostname
return jid
def get_account_from_jid(jid):
for account in app.config.get_per('accounts'):
if jid == get_jid_from_account(account):
return jid
def get_our_jids():
"""
Returns a list of the jids we use in our accounts