Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/presence
diff options
context:
space:
mode:
Diffstat (limited to 'sugar/presence')
-rw-r--r--sugar/presence/PresenceService.py2
-rw-r--r--sugar/presence/Service.py7
2 files changed, 7 insertions, 2 deletions
diff --git a/sugar/presence/PresenceService.py b/sugar/presence/PresenceService.py
index 7063b41..dc563b2 100644
--- a/sugar/presence/PresenceService.py
+++ b/sugar/presence/PresenceService.py
@@ -514,6 +514,8 @@ class PresenceService(gobject.GObject):
raise RuntimeError("presence service must be started first.")
rs_name = service.get_name()
+ if self.get_owner() and rs_name != self.get_owner().get_nick_name():
+ raise RuntimeError("Tried to register a service that didn't have Owner nick as the service name!")
rs_stype = service.get_full_type()
rs_port = service.get_port()
rs_props = service.get_properties()
diff --git a/sugar/presence/Service.py b/sugar/presence/Service.py
index e1232f6..e3885ad 100644
--- a/sugar/presence/Service.py
+++ b/sugar/presence/Service.py
@@ -143,9 +143,12 @@ class Service(object):
if uid and not self._properties.has_key(_ACTIVITY_UID_TAG):
self._properties[_ACTIVITY_UID_TAG] = uid
- def serialize(self):
+ def serialize(self, owner=None):
sdict = {}
- sdict['name'] = dbus.Variant(self._name)
+ if owner is not None:
+ sdict['name'] = dbus.Variant(owner.get_nick_name())
+ else:
+ sdict['name'] = dbus.Variant(self._name)
sdict['full_stype'] = dbus.Variant(self._full_stype)
sdict['activity_stype'] = dbus.Variant(self._activity_stype)
sdict['domain'] = dbus.Variant(self._domain)