From 52f2bea3ed542e65f22664b5c837280fdab6960d Mon Sep 17 00:00:00 2001 From: Morgan Collett Date: Wed, 22 Aug 2007 14:54:12 +0000 Subject: Use new PresenceService API for sharing by invitation only --- (limited to 'sugar/presence/presenceservice.py') diff --git a/sugar/presence/presenceservice.py b/sugar/presence/presenceservice.py index 81835fc..238012d 100644 --- a/sugar/presence/presenceservice.py +++ b/sugar/presence/presenceservice.py @@ -371,10 +371,14 @@ class PresenceService(gobject.GObject): _logger.debug("Error sharing activity %s: %s" % (activity.get_id(), err)) self.emit("activity-shared", False, None, err) - def share_activity(self, activity, properties={}): - """Ask presence service to ask the activity to share itself + def share_activity(self, activity, private=True): + """Ask presence service to ask the activity to share itself publicly. + + activity -- sugar.activity.activity.Activity instance + private -- bool: True to share by invitation only, + False to advertise as shared to everyone. - Uses the ShareActivity method on the service to ask for the + Uses the AdvertiseActivity method on the service to ask for the sharing of the given activity. Arranges to emit activity-shared event with: @@ -395,7 +399,8 @@ class PresenceService(gobject.GObject): atype = activity.get_service_name() name = activity.props.title - self._ps.ShareActivity(actid, atype, name, properties, + # FIXME: Test, then make this AdvertiseActivity: + self._ps.ShareActivity(actid, atype, name, private, reply_handler=lambda *args: self._share_activity_cb(activity, *args), error_handler=lambda *args: self._share_activity_error_cb(activity, *args)) -- cgit v0.9.1