diff options
author | Dan Williams <dcbw@redhat.com> | 2007-09-19 13:46:13 (GMT) |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2007-09-19 13:46:13 (GMT) |
commit | 6df1f3eca5d7791305b4fbf94f07301efa988a07 (patch) | |
tree | e981e3a73a29315e87039ffa35948012fdc1eb44 | |
parent | 62b56887187559521fe44cb300abedfa070e1520 (diff) |
* #3506: LL and server plugins are mutually exclusive for trial-3
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | src/presenceservice.py | 9 | ||||
-rw-r--r-- | src/telepathy_plugin.py | 13 |
3 files changed, 22 insertions, 2 deletions
@@ -1,3 +1,5 @@ +* #3506: LL and server plugins are mutually exclusive for trial-3 (dcbw) + Snapshot 46898a3e00 * Adapt to sugar API change (marco) diff --git a/src/presenceservice.py b/src/presenceservice.py index 8452410..218c974 100644 --- a/src/presenceservice.py +++ b/src/presenceservice.py @@ -148,8 +148,17 @@ class PresenceService(ExportedGObject): def _tp_status_cb(self, plugin, status, reason): if status == CONNECTION_STATUS_CONNECTED: self._tp_connected(plugin) + if plugin == self._server_plugin and self._ll_plugin: + # For now, Gabble takes precedence over Salut to alleviate + # corner cases where laptops on mesh can't talk to ones on APs + self._ll_plugin.cleanup() else: self._tp_disconnected(plugin) + if plugin == self._server_plugin and self._ll_plugin and status == CONNECTION_STATUS_DISCONNECTED: + # For now, Gabble takes precedence over Salut to alleviate + # corner cases where laptops on mesh can't talk to ones on APs + if self._ll_plugin.status == CONNECTION_STATUS_DISCONNECTED: + self._ll_plugin.start() def _tp_connected(self, tp): self._connected_plugins.add(tp) diff --git a/src/telepathy_plugin.py b/src/telepathy_plugin.py index f597476..6b99cbe 100644 --- a/src/telepathy_plugin.py +++ b/src/telepathy_plugin.py @@ -278,11 +278,20 @@ class TelepathyPlugin(gobject.GObject): self._conn[CONN_INTERFACE].Disconnect() except: pass - self._conn = None + self._conn_status = CONNECTION_STATUS_DISCONNECTED + self.emit('status', self._conn_status, 0) if self._online_contacts: - self._contacts_offline(self._online_contacts) + # Copy contacts when passing them to self._contacts_offline to + # ensure it's pass by _value_, otherwise (since it's a set) it's + # passed by reference and odd things happen when it gets subtracted + # from itself + self._contacts_offline(self._online_contacts.copy()) + + # Erase connection as the last thing done, because some of the + # above calls depend on self._conn being valid + self._conn = None def cleanup(self): self._stop() |