From 549a2df40347b20a81de30e90e9f35f6e344a66d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 25 Apr 2007 22:37:35 -0400 Subject: [PATCH] Make joining work --- tests/presence/mockps.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/presence/mockps.py b/tests/presence/mockps.py index 25a311a3..6f2f9c77 100755 --- a/tests/presence/mockps.py +++ b/tests/presence/mockps.py @@ -28,7 +28,8 @@ _ACTIVITY_PATH = "/org/laptop/Sugar/Presence/Activities/" _ACTIVITY_INTERFACE = "org.laptop.Sugar.Presence.Activity" class TestActivity(dbus.service.Object): - def __init__(self, bus_name, object_id, actid, name, color, atype, properties): + def __init__(self, bus_name, object_id, parent, actid, name, color, atype, properties): + self._parent = parent self._actid = actid self._aname = name self._color = color @@ -93,7 +94,9 @@ class TestActivity(dbus.service.Object): @dbus.service.method(_ACTIVITY_INTERFACE) def Join(self): - pass + owner = self._parent._owner + self.add_buddy(owner) + owner.add_activity(self) @dbus.service.method(_ACTIVITY_INTERFACE, out_signature="ao") def GetJoinedBuddies(self): @@ -311,7 +314,7 @@ class TestPresenceService(dbus.service.Object): objid = self._get_next_object_id() if not color: color = self._owner._color - act = TestActivity(self._bus_name, objid, actid, name, color, atype, properties) + act = TestActivity(self._bus_name, objid, self, actid, name, color, atype, properties) self._activities[actid] = act self.ActivityAppeared(act._object_path) return act