Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan Collett <morgan.collett@gmail.com>2007-10-11 10:56:35 (GMT)
committer Morgan Collett <morgan.collett@gmail.com>2007-10-15 16:04:43 (GMT)
commit7493d2c174e3fa658c7825e58069597431b686ec (patch)
treec106e32d92489ca02c4e985fd7232b4f2c7fef4b
parent93e30518e03922beea48c4d670feb59ad37c3078 (diff)
Emit BuddyHandleJoined when BuddyJoined emitted so sugar.presence will be able to track handles without calling PS
-rw-r--r--src/activity.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/activity.py b/src/activity.py
index c0f195d..a51ab33 100644
--- a/src/activity.py
+++ b/src/activity.py
@@ -319,6 +319,9 @@ class Activity(ExportedGObject):
# Pretend everyone joined
for buddy in self._buddies:
self.BuddyJoined(buddy.object_path())
+ handle = buddy.get_identifier_by_plugin(self._tp)
+ assert handle is not None
+ self.BuddyHandleJoined(buddy.object_path(), handle[0])
else:
# Pretend everyone left
for buddy in self._buddies:
@@ -338,6 +341,17 @@ class Activity(ExportedGObject):
_logger.debug('BuddyJoined: %s', buddy_path)
@dbus.service.signal(_ACTIVITY_INTERFACE,
+ signature="ou")
+ def BuddyHandleJoined(self, buddy_path, handle):
+ """Generates DBUS signal when a buddy joins this activity.
+
+ buddy_path -- DBUS path to buddy object
+ handle -- buddy handle in this activity
+ """
+ _logger.debug('BuddyHandleJoined: %s (handle %u)' %
+ (buddy_path, handle))
+
+ @dbus.service.signal(_ACTIVITY_INTERFACE,
signature="o")
def BuddyLeft(self, buddy_path):
"""Generates DBUS signal when a buddy leaves this activity.
@@ -347,6 +361,17 @@ class Activity(ExportedGObject):
_logger.debug('BuddyLeft: %s', buddy_path)
@dbus.service.signal(_ACTIVITY_INTERFACE,
+ signature="ou")
+ def BuddyHandleLeft(self, buddy_path, handle):
+ """Generates DBUS signal when a buddy leaves this activity.
+
+ buddy_path -- DBUS path to buddy object
+ handle -- buddy handle in this activity
+ """
+ _logger.debug('BuddyHandleLeft: %s (handle %u)' %
+ (buddy_path, handle))
+
+ @dbus.service.signal(_ACTIVITY_INTERFACE,
signature="a{sv}")
def PropertiesChanged(self, properties):
"""Emits D-Bus signal when properties of this activity change.
@@ -680,6 +705,9 @@ class Activity(ExportedGObject):
buddy.add_activity(self)
if self._valid:
self.BuddyJoined(buddy.object_path())
+ handle = buddy.get_identifier_by_plugin(self._tp)
+ assert handle is not None
+ self.BuddyHandleJoined(buddy.object_path(), handle[0])
else:
_logger.debug('Suppressing BuddyJoined: activity not "valid"')