From 5a90f9d407c7f55b70bc99da155126284acb9e3e Mon Sep 17 00:00:00 2001 From: Goffi Date: Sun, 7 Apr 2019 20:55:27 +0200 Subject: [PATCH] core, quick_frontend(app): fixed connected signal handling --- sat/bridge/bridge_constructor/bridge_template.ini | 4 ++-- sat/bridge/dbus_bridge.py | 6 +++--- sat/bridge/pb.py | 4 ++-- sat/core/xmpp.py | 6 ++---- sat_frontends/quick_frontend/quick_app.py | 2 +- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sat/bridge/bridge_constructor/bridge_template.ini b/sat/bridge/bridge_constructor/bridge_template.ini index 14bfd616..4a6f53ac 100644 --- a/sat/bridge/bridge_constructor/bridge_template.ini +++ b/sat/bridge/bridge_constructor/bridge_template.ini @@ -10,8 +10,8 @@ type=signal category=core sig_in=ss doc=Connection is done -doc_param_0=%(doc_profile)s -doc_param_1=jid_s: the JID that we were assigned by the server, as the resource might differ from the JID we asked for. +doc_param_0=jid_s: the JID that we were assigned by the server, as the resource might differ from the JID we asked for. +doc_param_1=%(doc_profile)s [disconnected] type=signal diff --git a/sat/bridge/dbus_bridge.py b/sat/bridge/dbus_bridge.py index a0200a8b..fd20af92 100644 --- a/sat/bridge/dbus_bridge.py +++ b/sat/bridge/dbus_bridge.py @@ -140,7 +140,7 @@ class DbusObject(dbus.service.Object): @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, signature='ss') - def connected(self, profile, jid_s): + def connected(self, jid_s, profile): pass @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, @@ -698,8 +698,8 @@ class Bridge(object): def actionNew(self, action_data, id, security_limit, profile): self.dbus_bridge.actionNew(action_data, id, security_limit, profile) - def connected(self, profile, jid_s): - self.dbus_bridge.connected(profile, jid_s) + def connected(self, jid_s, profile): + self.dbus_bridge.connected(jid_s, profile) def contactDeleted(self, entity_jid, profile): self.dbus_bridge.contactDeleted(entity_jid, profile) diff --git a/sat/bridge/pb.py b/sat/bridge/pb.py index f93f7c8d..2dbc5091 100644 --- a/sat/bridge/pb.py +++ b/sat/bridge/pb.py @@ -141,8 +141,8 @@ class Bridge(object): def actionNew(self, action_data, id, security_limit, profile): self.sendSignal("actionNew", action_data, id, security_limit, profile) - def connected(self, profile, jid_s): - self.sendSignal("connected", profile, jid_s) + def connected(self, jid_s, profile): + self.sendSignal("connected", jid_s, profile) def contactDeleted(self, entity_jid, profile): self.sendSignal("contactDeleted", entity_jid, profile) diff --git a/sat/core/xmpp.py b/sat/core/xmpp.py index e0b29e23..e3052c17 100644 --- a/sat/core/xmpp.py +++ b/sat/core/xmpp.py @@ -259,10 +259,8 @@ class SatXMPPEntity(object): self._connected_d.addCallback(self._disconnectionCb) self._connected_d.addErrback(self._disconnectionEb) - self.host_app.bridge.connected( - self.profile, unicode(self.jid) - ) # we send the signal to the clients - + # we send the signal to the clients + self.host_app.bridge.connected(self.jid.full(), self.profile) self.disco = SatDiscoProtocol(self) self.disco.setHandlerParent(self) diff --git a/sat_frontends/quick_frontend/quick_app.py b/sat_frontends/quick_frontend/quick_app.py index 8707613c..40ccb2bd 100644 --- a/sat_frontends/quick_frontend/quick_app.py +++ b/sat_frontends/quick_frontend/quick_app.py @@ -682,7 +682,7 @@ class QuickApp(object): # bridge signals hanlers - def connectedHandler(self, profile, jid_s): + def connectedHandler(self, jid_s, profile): """Called when the connection is made. @param jid_s (unicode): the JID that we were assigned by the server,