# HG changeset patch # User Goffi # Date 1652457163 -7200 # Node ID 9581098b64f0ec1714f9dd0402cd603141aaae97 # Parent 53a8b50d69caef41deb7d8ccb2daadaad3e107fc core (xmpp): add a `server_jid` property diff -r 53a8b50d69ca -r 9581098b64f0 sat/core/xmpp.py --- a/sat/core/xmpp.py Tue Mar 22 17:00:42 2022 +0100 +++ b/sat/core/xmpp.py Fri May 13 17:52:43 2022 +0200 @@ -849,6 +849,9 @@ 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 @@ 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