summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Klinikowski <kkszysiu@gmail.com>2010-05-27 14:54:19 +0200
committerKrzysztof Klinikowski <kkszysiu@gmail.com>2010-05-27 14:54:19 +0200
commit3998d09a3d3047ab9f154701c5fc86b7376207dd (patch)
tree54908c2d8f14f6f1d39055b2d08617da8ff57962
parentecb7a77e2905e145affea0603b74df95866a20a0 (diff)
Fixed bug in capabilities.
-rw-r--r--sunshine/capabilities.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/sunshine/capabilities.py b/sunshine/capabilities.py
index f2421a9..3d06b5f 100644
--- a/sunshine/capabilities.py
+++ b/sunshine/capabilities.py
@@ -86,19 +86,20 @@ class SunshineCapabilities(telepathy.server.ConnectionInterfaceCapabilities,
def GetContactCapabilities(self, handles):
- print handles
if 0 in handles:
raise telepathy.InvalidHandle('Contact handle list contains zero')
- #a{ua(a{sv}as)}
ret = dbus.Dictionary({}, signature='ua(a{sv}as)')
for i in handles:
- print i
handle = self.handle(telepathy.HANDLE_TYPE_CONTACT, i)
+ # If the handle has no contact capabilities yet then it
+ # won't be in the dict. It's fair to return an empty list
+ # here for its contact caps.
if handle in self._contact_caps:
- ret[handle] = dbus.Array(self._contact_caps[handle], signature='(a{sv}as)')
+ ret[handle] = dbus.Array(self._contact_caps[handle], signature='(a{sv}as)')
else:
- ret[handle] = []
+ ret[handle] = dbus.Array([], signature='(a{sv}as)')
+
return ret
def UpdateCapabilities(self, caps):