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 <mpg@redhat.com>2006-06-18 02:06:20 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2006-06-18 02:06:20 (GMT)
commit6d7940949adff699c609b0d11c9a7959087cfab8 (patch)
treed8af22db91e4b94729c8c3ea1724220493e3d07a /sugar/presence/Service.py
parent53f00b05b14aa90ce2bc00d9789e15a6486fde63 (diff)
Empty addresses are valid, meaning the buddy own address.
For group (multicast) services publisher_address != service_address, introduce the distinction in the API and in the avahi announcement.
Diffstat (limited to 'sugar/presence/Service.py')
-rw-r--r--sugar/presence/Service.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/sugar/presence/Service.py b/sugar/presence/Service.py
index 4740f78..c97830f 100644
--- a/sugar/presence/Service.py
+++ b/sugar/presence/Service.py
@@ -92,12 +92,16 @@ class Service(object):
self._full_stype = full_stype
self._activity_stype = short_stype
self._domain = domain
- self._address = None
- self.set_address(address)
self._port = -1
self.set_port(port)
self._properties = {}
self.set_properties(properties)
+ self._publisher_address = address
+ self._address = None
+ if self._properties.has_key('address'):
+ self.set_address(self._properties['address'])
+ else:
+ self.set_address(address)
# Ensure that an ActivityUID tag, if given, matches
# what we expect from the service type
@@ -166,6 +170,9 @@ class Service(object):
raise ValueError("must specify a valid port number.")
self._port = port
+ def get_publisher_address(self):
+ return self._publisher_address
+
def get_address(self):
return self._address
@@ -173,8 +180,6 @@ class Service(object):
if address is not None:
if type(address) != type("") and type(address) != type(u""):
raise ValueError("must specify a valid address.")
- if not len(address):
- raise ValueError("must specify a valid address.")
if address and type(address) == type(u""):
address = address.encode()
self._address = address