core (xmpp): add a server_jid property

This commit is contained in:
Goffi 2022-05-13 17:52:43 +02:00
commit 0a23ca36cb

View file

@ -849,6 +849,9 @@ class SatXMPPClient(SatXMPPEntity, wokkel_client.XMPPClient):
xml_tools.quickNote(host_app, self, msg, _("Security notice"),
level = C.XMLUI_DATA_LVL_WARNING)
@property
def server_jid(self):
return jid.JID(self.jid.host)
def _getPluginsList(self):
for p in self.host_app.plugins.values():
@ -1001,6 +1004,11 @@ class SatXMPPComponent(SatXMPPEntity, component.Component):
component.Component.__init__(self, host, port, component_jid.full(), password)
SatXMPPEntity.__init__(self, host_app, profile, max_retries)
@property
def server_jid(self):
# FIXME: not the best way to get server jid, maybe use config option?
return jid.JID(self.jid.host.split(".", 1)[-1])
def _buildDependencies(self, current, plugins, required=True):
"""build recursively dependencies needed for a plugin