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>2006-10-20 17:15:23 (GMT)
committer Dan Williams <dcbw@redhat.com>2006-10-20 17:15:23 (GMT)
commit1226b0b6b957f70b7885535b1f0213ed7072dc9a (patch)
tree508a285c4d6e16c866ab0bbb9aa79666778ffa89 /services
parentfe448938b1a9792250e0bd9a75f0eda4fcd793a5 (diff)
Fix Buddy object's get_service_of_type() method
This call would always fail for activity services because the dbus bindings for it did not pass in the activity at all. Fix that.
Diffstat (limited to 'services')
-rw-r--r--services/presence/Buddy.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/services/presence/Buddy.py b/services/presence/Buddy.py
index a98982e..a49b46a 100644
--- a/services/presence/Buddy.py
+++ b/services/presence/Buddy.py
@@ -88,9 +88,18 @@ class BuddyDBusHelper(dbus.service.Object):
return icon
@dbus.service.method(BUDDY_DBUS_INTERFACE,
- in_signature="s", out_signature="o")
- def getServiceOfType(self, stype):
- service = self._parent.get_service_of_type(stype)
+ in_signature="so", out_signature="o")
+ def getServiceOfType(self, stype, activity_op):
+ activity = None
+ # "/" is the placeholder for None
+ if activity_op != "/":
+ for act in self._parent.get_joined_activities():
+ if act.object_path() == activity_op:
+ activity = act
+ if not activity:
+ raise NotFoundError("Not found")
+
+ service = self._parent.get_service_of_type(stype, activity)
if not service:
raise NotFoundError("Not found")
return service.object_path()
@@ -357,7 +366,7 @@ class Buddy(object):
acts.append(act)
return acts
- def get_service_of_type(self, stype=None, activity=None):
+ def get_service_of_type(self, stype, activity=None):
"""Return a service of a certain type, or None if the buddy
doesn't provide that service."""
if not stype: