# HG changeset patch # User Goffi # Date 1322923548 -3600 # Node ID 62145e50eae547744487439a20beb2cc8b345e4d # Parent 02c633a0ddcfe103c865cee7440466f39c3cbf0b core: plugins can now have profileConnected/profileDisconnected method to initialise/free profile dependant resources diff -r 02c633a0ddcf -r 62145e50eae5 src/core/sat_main.py --- a/src/core/sat_main.py Wed Nov 30 00:24:41 2011 +0100 +++ b/src/core/sat_main.py Sat Dec 03 15:45:48 2011 +0100 @@ -247,6 +247,9 @@ for plugin in self.plugins.iteritems(): if plugin[1].is_handler: plugin[1].getHandler(profile).setHandlerParent(current) + connected_cb = getattr(plugin[1], "profileConnected", None) + if connected_cb: + connected_cb(profile) current.startService() @@ -262,6 +265,10 @@ profile = self.memory.getProfileName(profile_key) info(_("Disconnecting...")) self.profiles[profile].stopService() + for plugin in self.plugins.iteritems(): + disconnected_cb = getattr(plugin[1], "profileDisconnected", None) + if disconnected_cb: + disconnected_cb(profile) def purgeClient(self, profile): """Remove reference to a profile client and purge cache diff -r 02c633a0ddcf -r 62145e50eae5 src/core/xmpp.py --- a/src/core/xmpp.py Wed Nov 30 00:24:41 2011 +0100 +++ b/src/core/xmpp.py Sat Dec 03 15:45:48 2011 +0100 @@ -229,8 +229,8 @@ def available(self, entity=None, show=None, statuses=None, priority=0): if not statuses: statuses = {} - # default for us is None for wokkel - # so we must temporarily switch to wokkel's convention... + # default for us is None for wokkel + # so we must temporarily switch to wokkel's convention... if 'default' in statuses: statuses[None] = statuses['default']