Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-04-13 20:59:16 (GMT)
committer Dan Williams <dcbw@redhat.com>2007-04-13 20:59:16 (GMT)
commit879ef9b0e04ee9ac2f615dc91e05c5a64d5da0b2 (patch)
tree86d4f42af19f05e3adce3a5185f2f5d32597a18f /services
parent99737f827305517d5f3e004eab6c1f07326748c1 (diff)
Add activity to owner's list after sharing it
Diffstat (limited to 'services')
-rw-r--r--services/presence/activity.py7
-rw-r--r--services/presence/presenceservice.py7
2 files changed, 9 insertions, 5 deletions
diff --git a/services/presence/activity.py b/services/presence/activity.py
index 6a4ee56..7471b46 100644
--- a/services/presence/activity.py
+++ b/services/presence/activity.py
@@ -229,7 +229,7 @@ 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:
@@ -238,16 +238,17 @@ class Activity(DBusGObject):
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):
diff --git a/services/presence/presenceservice.py b/services/presence/presenceservice.py
index 9fa3483..fd4cbb6 100644
--- a/services/presence/presenceservice.py
+++ b/services/presence/presenceservice.py
@@ -169,7 +169,10 @@ class PresenceService(dbus.service.Object):
del self._activities[activity.props.id]
def _buddy_activities_changed(self, tp, contact_handle, activities):
- logging.debug("------------activities changed-------------")
+ acts = []
+ for act in activities:
+ acts.append(str(act))
+ logging.debug("Handle %s activities changed: %s" % (contact_handle, acts))
buddies = self._handles_buddies[tp]
buddy = buddies.get(contact_handle)
@@ -306,7 +309,7 @@ class PresenceService(dbus.service.Object):
id=actid, type=atype, name=name, color=color, local=True)
activity.connect("validity-changed", self._activity_validity_changed_cb)
self._activities[actid] = activity
- activity._share(callbacks)
+ activity._share(callbacks, self._owner)
# local activities are valid at creation by definition, but we can't
# connect to the activity's validity-changed signal until its already