From d2c4f2594a473a081cd919a255950608cde3dbc7 Mon Sep 17 00:00:00 2001 From: Goffi Date: Tue, 5 Nov 2013 22:40:56 +0100 Subject: [PATCH] plugin XEP-0115: changed node for "http://sat.goffi.org" + filtering using list comprehension instead of filter() --- src/plugins/plugin_xep_0115.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/plugin_xep_0115.py b/src/plugins/plugin_xep_0115.py index 8781056b..868c7cd8 100755 --- a/src/plugins/plugin_xep_0115.py +++ b/src/plugins/plugin_xep_0115.py @@ -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)