Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2007-05-22 15:43:45 (GMT)
committer Simon McVittie <simon.mcvittie@collabora.co.uk>2007-05-24 17:47:55 (GMT)
commit7b1a38af1cefe3aed5436a62fa5ddcdd68bb3082 (patch)
tree2cbbf97ea1f25280498365fc2801e3310bc1bde0 /services
parent10e1daf8c61e5d3b5765d7d138d7d8e014dd30b2 (diff)
services/presence/: keep track of the owner's Telepathy handles
Diffstat (limited to 'services')
-rw-r--r--services/presence/presenceservice.py7
-rw-r--r--services/presence/server_plugin.py5
2 files changed, 10 insertions, 2 deletions
diff --git a/services/presence/presenceservice.py b/services/presence/presenceservice.py
index 6273a22..0add473 100644
--- a/services/presence/presenceservice.py
+++ b/services/presence/presenceservice.py
@@ -107,12 +107,19 @@ class PresenceService(ExportedGObject):
_logger.debug("Disconnected from session bus!!!")
def _server_status_cb(self, plugin, status, reason):
+
# FIXME: figure out connection status when we have a salut plugin too
old_status = self._connected
if status == CONNECTION_STATUS_CONNECTED:
self._connected = True
+ self._handles_buddies[plugin][plugin.self_handle] = self._owner
+ self._owner.add_telepathy_handle(plugin, plugin.self_handle)
else:
self._connected = False
+ if plugin.self_handle is not None:
+ self._handles_buddies.setdefault(plugin, {}).pop(
+ plugin.self_handle, None)
+ self._owner.remove_telepathy_handle(plugin, plugin.self_handle)
if self._connected != old_status:
self.emit('connection-status', self._connected)
diff --git a/services/presence/server_plugin.py b/services/presence/server_plugin.py
index a886fdb..6b21888 100644
--- a/services/presence/server_plugin.py
+++ b/services/presence/server_plugin.py
@@ -137,6 +137,7 @@ class ServerPlugin(gobject.GObject):
self._owner = owner
self._owner.connect("property-changed", self._owner_property_changed_cb)
self._owner.connect("icon-changed", self._owner_icon_changed_cb)
+ self.self_handle = None
self._account = self._get_account_info()
self._conn_status = CONNECTION_STATUS_DISCONNECTED
@@ -348,8 +349,8 @@ class ServerPlugin(gobject.GObject):
# accept pending subscriptions
publish[CHANNEL_INTERFACE_GROUP].AddMembers(local_pending, '')
- self_handle = self._conn[CONN_INTERFACE].GetSelfHandle()
- self._online_contacts[self_handle] = self._account['account']
+ self.self_handle = self._conn[CONN_INTERFACE].GetSelfHandle()
+ self._online_contacts[self.self_handle] = self._account['account']
# request subscriptions from people subscribed to us if we're not subscribed to them
not_subscribed = list(set(publish_handles) - set(subscribe_handles))