Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/presence/Service.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-06-22 22:07:54 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-06-22 22:07:54 (GMT)
commit59f25b07418e5f1143d9ddf94b5497ca9436f8d9 (patch)
tree701fe4b08c2945cc0b62ecce3f85ad74b4cf9df5 /sugar/presence/Service.py
parentc234b7b4a396ce523692d5516c3cc4fb159d9d0c (diff)
Get one-to-one chat to actually work...
Diffstat (limited to 'sugar/presence/Service.py')
-rw-r--r--sugar/presence/Service.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/sugar/presence/Service.py b/sugar/presence/Service.py
index 56246bb..c82d019 100644
--- a/sugar/presence/Service.py
+++ b/sugar/presence/Service.py
@@ -69,9 +69,6 @@ def deserialize(sdict):
stype = sdict['stype']
if type(stype) == type(u""):
stype = stype.encode()
- activity_id = sdict['activity_id']
- if type(activity_id) == type(u""):
- activity_id = activity_id.encode()
domain = sdict['domain']
if type(domain) == type(u""):
domain = domain.encode()
@@ -87,7 +84,18 @@ def deserialize(sdict):
address = address.encode()
except KeyError:
pass
- name = compose_service_name(name, activity_id)
+
+ activity_id = None
+ try:
+ activity_id = sdict['activity_id']
+ if type(activity_id) == type(u""):
+ activity_id = activity_id.encode()
+ except KeyError:
+ pass
+
+ if activity_id is not None:
+ name = compose_service_name(name, activity_id)
+
return Service(name, stype, domain, address=address,
port=port, properties=properties)
@@ -152,7 +160,8 @@ class Service(object):
else:
sdict['name'] = dbus.Variant(self._name)
sdict['stype'] = dbus.Variant(self._stype)
- sdict['activity_id'] = dbus.Variant(self._activity_id)
+ if self._activity_id:
+ sdict['activity_id'] = dbus.Variant(self._activity_id)
sdict['domain'] = dbus.Variant(self._domain)
if self._address:
sdict['address'] = dbus.Variant(self._address)