diff options
author | Morgan Collett <morgan.collett@gmail.com> | 2007-09-08 13:47:52 (GMT) |
---|---|---|
committer | Morgan Collett <morgan.collett@gmail.com> | 2007-09-08 13:47:52 (GMT) |
commit | 3b1f4a0c42f9495442213fb17c9826f7945a3028 (patch) | |
tree | faa13ce5d89275448d328b7be36e0dd52d6cbe41 | |
parent | bd8e6ca3a36860b092cb9b1b6b4c167bdef540f3 (diff) |
#3147: Set _PROP_CURACT for the owner when sharing an activity
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | src/activity.py | 2 | ||||
-rw-r--r-- | src/buddy.py | 5 |
3 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,6 @@ +* #3147: Set _PROP_CURACT to current activity when sharing an activity + or joining (morgs) + Snapshot a79f7b6488 * Fix non-ASCII activity names (smcv) diff --git a/src/activity.py b/src/activity.py index be721b7..2c13488 100644 --- a/src/activity.py +++ b/src/activity.py @@ -779,6 +779,8 @@ class Activity(ExportedGObject): if self._join_is_sharing: self.send_properties() self._ps.owner.add_activity(self) + else: + self._ps.owner.set_properties({'current-activity': self.props.id}) self._join_cb() _logger.debug("%s of activity %s succeeded" % (verb, self._id)) except Exception, e: diff --git a/src/buddy.py b/src/buddy.py index 322ae02..23f0f64 100644 --- a/src/buddy.py +++ b/src/buddy.py @@ -437,6 +437,7 @@ class Buddy(ExportedGObject): """Join or leave the activity when its validity changes""" if valid: self.JoinedActivity(activity.object_path()) + self.set_properties({_PROP_CURACT: activity.props.id}) else: self.LeftActivity(activity.object_path()) @@ -584,7 +585,7 @@ class Buddy(ExportedGObject): def update_current_activity(self, tp, current_activity): """Update the current activity from the given Telepathy connection. """ - self.set_properties({'current-activity': current_activity}) + self.set_properties({_PROP_CURACT: current_activity}) def update_avatar(self, tp, new_avatar_token, icon=None, mime_type=None): """Handle update of the avatar""" @@ -674,6 +675,7 @@ class GenericOwner(Buddy): del id_to_act[activity_id] self._set_self_activities(tp) + self.set_properties({_PROP_CURACT: None}) def _set_self_activities(self, tp): """Forward set of joined activities to network @@ -1008,4 +1010,3 @@ class ShellOwner(GenericOwner): activity_id = None props = {_PROP_CURACT: activity_id} self.set_properties(props) - |