Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/presence
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-06-19 19:31:32 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-06-19 19:31:32 (GMT)
commit9c0669dde49344ade510e0c3c9780f864be2b8fd (patch)
tree5c774674f7a827528225860ae29a32d7b6745c18 /sugar/presence
parent4cef4cb3bdf5620f2cdd956c52daa4a17e045171 (diff)
parent028f033344962f7a481adcf48aeecce9349b13d6 (diff)
Merge branch 'master' of git+ssh://crank.laptop.org/git/sugar
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)