# HG changeset patch # User Goffi # Date 1383687656 -3600 # Node ID a79a6843928c995d405e07283dc82a76d37d0ecd # Parent 2a7185b8452c1850c6f5ce815b94250c7d701b4f plugin XEP-0115: changed node for "http://sat.goffi.org" + filtering using list comprehension instead of filter() diff -r 2a7185b8452c -r a79a6843928c src/plugins/plugin_xep_0115.py --- a/src/plugins/plugin_xep_0115.py Tue Nov 05 22:40:55 2013 +0100 +++ b/src/plugins/plugin_xep_0115.py Tue Nov 05 22:40:56 2013 +0100 @@ -101,7 +101,7 @@ 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 @@ 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)