# HG changeset patch # User Goffi # Date 1583535949 -3600 # Node ID 12d188cb1206639350d0dae7c2b98f3c3d6b8192 # Parent 58d3ea442f9cc53aef4544aa6770c905b980dd49 core: use of new profileConnected method: bookmarks cache is now retrieved in profileConnected, as getting it in ProfilePlugged could result in an exception is client was not fully connected (if plugins were not all initialised). diff -r 58d3ea442f9c -r 12d188cb1206 cagou/core/cagou_main.py --- a/cagou/core/cagou_main.py Sat Mar 07 00:05:49 2020 +0100 +++ b/cagou/core/cagou_main.py Sat Mar 07 00:05:49 2020 +0100 @@ -548,16 +548,18 @@ del self.app._profile_manager super(Cagou, self).postInit(profile_manager) + def profilePlugged(self, profile): + super().profilePlugged(profile) + # FIXME: this won't work with multiple profiles + self.app.connected = self.profiles[profile].connected + def _bookmarksListCb(self, bookmarks_dict, profile): bookmarks = set() for data in bookmarks_dict.values(): bookmarks.update({jid.JID(k) for k in data.keys()}) self.profiles[profile]._bookmarks = sorted(bookmarks) - def profilePlugged(self, profile): - super().profilePlugged(profile) - # FIXME: this won't work with multiple profiles - self.app.connected = self.profiles[profile].connected + def profileConnected(self, profile): self.bridge.bookmarksList( "muc", "all", profile, callback=partial(self._bookmarksListCb, profile=profile),