plugin XEP-0115: changed node for "http://sat.goffi.org" + filtering using list comprehension instead of filter()
This commit is contained in:
parent
109d61352f
commit
d2c4f2594a
1 changed files with 3 additions and 3 deletions
|
|
@ -101,7 +101,7 @@ class XEP_0115(object):
|
|||
presenceInst = client.presence
|
||||
c_elt = domish.Element((NS_ENTITY_CAPABILITY, 'c'))
|
||||
c_elt['hash'] = 'sha-1'
|
||||
c_elt['node'] = 'http://wiki.goffi.org/wiki/Salut_%C3%A0_Toi'
|
||||
c_elt['node'] = 'http://sat.goffi.org'
|
||||
c_elt['ver'] = XEP_0115.cap_hash
|
||||
presenceInst._c_elt = c_elt
|
||||
if "_legacy_send" in dir(presenceInst):
|
||||
|
|
@ -130,14 +130,14 @@ class XEP_0115(object):
|
|||
|
||||
def generateHash_2(services, profile):
|
||||
_s = []
|
||||
byte_identities = [ByteIdentity(identity) for identity in filter(lambda x: isinstance(x, disco.DiscoIdentity), services)] # FIXME: lang must be managed here
|
||||
byte_identities = [ByteIdentity(service) for service in services if isinstance(service, disco.DiscoIdentity)] # FIXME: lang must be managed here
|
||||
byte_identities.sort(key=lambda i: i.lang)
|
||||
byte_identities.sort(key=lambda i: i.idType)
|
||||
byte_identities.sort(key=lambda i: i.category)
|
||||
for identity in byte_identities:
|
||||
_s.append(str(identity))
|
||||
_s.append('<')
|
||||
byte_features = [feature.encode('utf-8') for feature in filter(lambda x: isinstance(x, disco.DiscoFeature), services)]
|
||||
byte_features = [service.encode('utf-8') for service in services if isinstance(service, disco.DiscoFeature)]
|
||||
byte_features.sort() # XXX: the default sort has the same behaviour as the requested RFC 4790 i;octet sort
|
||||
for feature in byte_features:
|
||||
_s.append(feature)
|
||||
|
|
|
|||
Loading…
Reference in a new issue