Get one-to-one chat to actually work...
This commit is contained in:
@@ -142,8 +142,8 @@ class Buddy(gobject.GObject):
|
||||
for service in self._services.values():
|
||||
if service.get_type() == stype and service.get_activity_id() == actid:
|
||||
return service
|
||||
if self._services.has_key(short_stype):
|
||||
return self._services[short_stype]
|
||||
if self._services.has_key(stype):
|
||||
return self._services[stype]
|
||||
return None
|
||||
|
||||
def is_valid(self):
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user