Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/presence/activity.py
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-05-03 03:25:15 (GMT)
committer Dan Williams <dcbw@redhat.com>2007-05-03 03:25:15 (GMT)
commit7774073276de007dbf02c4f36aeeef3d56151bff (patch)
treed3dc6435490f05523159df3e1ec2f5f99d75c3da /sugar/presence/activity.py
parent46d97015e61d9969840f1b36980b80af18e38ac1 (diff)
Make joining asynchronous on the activity side
Diffstat (limited to 'sugar/presence/activity.py')
-rw-r--r--sugar/presence/activity.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/sugar/presence/activity.py b/sugar/presence/activity.py
index 31638ac..3681f91 100644
--- a/sugar/presence/activity.py
+++ b/sugar/presence/activity.py
@@ -36,10 +36,12 @@ class Activity(gobject.GObject):
__gsignals__ = {
'buddy-joined': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
([gobject.TYPE_PYOBJECT])),
- 'buddy-left': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
+ 'buddy-left': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
([gobject.TYPE_PYOBJECT])),
- 'new-channel': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
- ([gobject.TYPE_PYOBJECT]))
+ 'new-channel': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
+ ([gobject.TYPE_PYOBJECT])),
+ 'joined': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
+ ([gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT]))
}
__gproperties__ = {
@@ -137,15 +139,22 @@ class Activity(gobject.GObject):
buddies.append(self._ps_new_object(item))
return buddies
+ def _join_cb(self):
+ self._joined = True
+ self.emit("joined", True, None)
+
+ def _join_error_cb(self, err):
+ self.emit("joined", False, str(err))
+
def join(self):
"""Join this activity
XXX if these are all activities, can I join my own activity?
"""
if self._joined:
+ self.emit("joined", True, None)
return
- self._activity.Join()
- self._joined = True
+ self._activity.Join(reply_handler=self._join_cb, error_handler=self._join_error_cb)
def get_channels(self):
"""Retrieve communications channel descriptions for the activity
@@ -157,7 +166,6 @@ class Activity(gobject.GObject):
(bus_name, connection, channels) = self._activity.GetChannels()
return bus_name, connection, channels
- def owner_has_joined(self):
- """Retrieve whether the owner of the activity is active within it"""
+ def leave(self):
# FIXME
- return False
+ self._joined = False