Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/lib/sugar/presence/presenceservice.py
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2007-10-29 17:21:33 (GMT)
committer Simon McVittie <simon.mcvittie@collabora.co.uk>2007-10-29 17:21:33 (GMT)
commit249521253dfc61248a22133c6624225234515eb5 (patch)
tree6621b031ccb996cf0eaae239dad6d4cfc224750f /lib/sugar/presence/presenceservice.py
parentf60f77d471a2b919d2f4071e7e3d7e9a9e4ff805 (diff)
Do some standard Tubes boilerplate in sugar.presence, so activities don't have to (#4503)
Diffstat (limited to 'lib/sugar/presence/presenceservice.py')
-rw-r--r--lib/sugar/presence/presenceservice.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/sugar/presence/presenceservice.py b/lib/sugar/presence/presenceservice.py
index dea0c7c..2107f4a 100644
--- a/lib/sugar/presence/presenceservice.py
+++ b/lib/sugar/presence/presenceservice.py
@@ -425,20 +425,24 @@ class PresenceService(gobject.GObject):
return self._new_object(owner_op)
def _share_activity_cb(self, activity, psact):
- """Notify with GObject event of successful sharing of activity
+ """Finish sharing the activity
"""
psact._joined = True
- self.emit("activity-shared", True, psact, None)
+ _logger.debug('%r: Just shared, setting up tubes', activity)
+ psact.set_up_tubes(reply_handler=lambda:
+ self.emit("activity-shared", True, psact, None),
+ error_handler=lambda e:
+ self._share_activity_error_cb(activity, e))
def _share_activity_privacy_cb(self, activity, private, op):
psact = self._new_object(op)
- # FIXME: this should be done asynchronously (more API needed)
- try:
- psact.props.private = private
- except Exception, e:
- self._share_activity_error_cb(activity, e)
- else:
- self._share_activity_cb(activity, psact)
+ _logger.debug('%r: Just shared, setting privacy to %r', activity,
+ private)
+ psact.set_private(private,
+ reply_handler=lambda:
+ self._share_activity_cb(activity, psact),
+ error_handler=lambda e:
+ self._share_activity_error_cb(activity, e))
def _share_activity_error_cb(self, activity, err):
"""Notify with GObject event of unsuccessful sharing of activity"""