From 093ba8dd97716d41e1d53f4db170dc7410fdef5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Thu, 10 May 2018 10:53:56 +0200 Subject: [PATCH] Provide method to get the account name from a jid --- gajim/common/app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gajim/common/app.py b/gajim/common/app.py index 2506a921e..dfef45599 100644 --- a/gajim/common/app.py +++ b/gajim/common/app.py @@ -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