From fc41d45039ee709acc01702601cd5e29cc41ead8 Mon Sep 17 00:00:00 2001 From: Goffi Date: Sun, 7 Apr 2019 21:09:49 +0200 Subject: [PATCH] quick frontend (app): (un)set sync state on (dis)connect: when connected signal is received, a whole (re)connection has happened, meaning that everything is potentially out of sync (opened widget and contact lists), so host.sync is set accordingly. It's a temporary option, as (dis)connect is a per-profile signal, and host.sync is global. Methods similar to sync workflow must be implemented on a per-profile basis. --- sat_frontends/quick_frontend/quick_app.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sat_frontends/quick_frontend/quick_app.py b/sat_frontends/quick_frontend/quick_app.py index 0e21a24e..c40dd420 100644 --- a/sat_frontends/quick_frontend/quick_app.py +++ b/sat_frontends/quick_frontend/quick_app.py @@ -696,12 +696,22 @@ class QuickApp(object): log.debug(_("Connected")) self.profiles[profile].whoami = jid.JID(jid_s) self.setPresenceStatus(profile=profile) + # FIXME: fill() is already called for all profiles when doing self.sync = True + # a per-profile fill() should be done once, see below note self.contact_lists[profile].fill() + # if we were already displaying widgets, they must be resynchronized + # FIXME: self.sync is for all profiles + # while (dis)connection is per-profile. + # A mechanism similar to sync should be available + # on a per-profile basis + self.sync = True def disconnectedHandler(self, profile): """called when the connection is closed""" log.debug(_("Disconnected")) self.contact_lists[profile].disconnect() + # FIXME: see note on connectedHandler + self.sync = False self.setPresenceStatus(C.PRESENCE_UNAVAILABLE, "", profile=profile) def actionNewHandler(self, action_data, id_, security_limit, profile):