cli: helper method to retrieve profile's jid:
rel 369
This commit is contained in:
parent
9e2f4571f6
commit
e84436adfd
1 changed files with 11 additions and 1 deletions
|
|
@ -697,7 +697,10 @@ class LiberviaCli:
|
|||
await self.bridge.bridgeConnect()
|
||||
except Exception as e:
|
||||
if isinstance(e, exceptions.BridgeExceptionNoService):
|
||||
print(_("Can't connect to SàT backend, are you sure it's launched ?"))
|
||||
print(
|
||||
_("Can't connect to Libervia backend, are you sure that it's "
|
||||
"launched ?")
|
||||
)
|
||||
self.quit(C.EXIT_BACKEND_NOT_FOUND, raise_exc=False)
|
||||
elif isinstance(e, exceptions.BridgeInitError):
|
||||
print(_("Can't init bridge"))
|
||||
|
|
@ -968,6 +971,13 @@ class LiberviaCli:
|
|||
return f"{_jid.bare}/{main_resource}"
|
||||
return param_jid
|
||||
|
||||
async def get_profile_jid(self):
|
||||
"""Retrieve current profile bare JID if possible"""
|
||||
full_jid = await self.bridge.asyncGetParamA(
|
||||
"JabberID", "Connection", profile_key=self.profile
|
||||
)
|
||||
return full_jid.rsplit("/", 1)[0]
|
||||
|
||||
|
||||
class CommandBase(object):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue