diff options
Diffstat (limited to 'services/presence/activity.py')
-rw-r--r-- | services/presence/activity.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/services/presence/activity.py b/services/presence/activity.py index 3638a96..7471b46 100644 --- a/services/presence/activity.py +++ b/services/presence/activity.py @@ -18,6 +18,7 @@ import gobject import dbus, dbus.service from sugar import util +import logging from telepathy.interfaces import (CHANNEL_INTERFACE) @@ -228,22 +229,27 @@ class Activity(DBusGObject): # Not for us return - (sigid, async_cb, async_err_cb) = userdata + (sigid, owner, async_cb, async_err_cb) = userdata self._tp.disconnect(sigid) if exc: + logging.debug("Share of activity %s failed: %s" % (self._id, exc)) async_err_cb(exc) else: self._handle_share_join(tp, text_channel) self.send_properties() + owner.add_activity(self) async_cb(dbus.ObjectPath(self._object_path)) + logging.debug("Share of activity %s succeeded." % self._id) - def _share(self, (async_cb, async_err_cb)): + def _share(self, (async_cb, async_err_cb), owner): + logging.debug("Starting share of activity %s" % self._id) if self._joined: async_err_cb(RuntimeError("Already shared activity %s" % self.props.id)) return sigid = self._tp.connect('activity-shared', self._shared_cb) - self._tp.share_activity(self.props.id, (sigid, async_cb, async_err_cb)) + self._tp.share_activity(self.props.id, (sigid, owner, async_cb, async_err_cb)) + logging.debug("done with share attempt %s" % self._id) def _joined_cb(self, tp, activity_id, text_channel, exc, userdata): if activity_id != self.props.id: |