Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan 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)
commit3b1f4a0c42f9495442213fb17c9826f7945a3028 (patch)
treefaa13ce5d89275448d328b7be36e0dd52d6cbe41
parentbd8e6ca3a36860b092cb9b1b6b4c167bdef540f3 (diff)
#3147: Set _PROP_CURACT for the owner when sharing an activity
-rw-r--r--NEWS3
-rw-r--r--src/activity.py2
-rw-r--r--src/buddy.py5
3 files changed, 8 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 9f2ee29..e48cbb7 100644
--- a/NEWS
+++ b/NEWS
@@ -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)
-