comparison src/plugins/plugin_xep_0300.py @ 2148:a543eda2c923

core (memory/disco): getInfos now handle node + use client instead of profile in many methods
author Goffi <goffi@goffi.org>
date Sun, 12 Feb 2017 20:43:20 +0100
parents 33c8c4973743
children 8b37a62336c3
comparison
equal deleted inserted replaced
2147:bca699faf416 2148:a543eda2c923
81 @param to_jid(jid.JID): peer jid 81 @param to_jid(jid.JID): peer jid
82 @parm profile: %(doc_profile)s 82 @parm profile: %(doc_profile)s
83 @return (D(unicode, None)): best available algorithm, 83 @return (D(unicode, None)): best available algorithm,
84 or None if hashing is not possible 84 or None if hashing is not possible
85 """ 85 """
86 client = self.host.getClient(profile)
86 for algo in reversed(XEP_0300.ALGOS): 87 for algo in reversed(XEP_0300.ALGOS):
87 has_feature = yield self.host.hasFeature(NS_HASHES_FUNCTIONS.format(algo), to_jid, profile) 88 has_feature = yield self.host.hasFeature(client, NS_HASHES_FUNCTIONS.format(algo), to_jid)
88 if has_feature: 89 if has_feature:
89 log.debug(u"Best hashing algorithm found for {jid}: {algo}".format( 90 log.debug(u"Best hashing algorithm found for {jid}: {algo}".format(
90 jid=to_jid.full(), 91 jid=to_jid.full(),
91 algo=algo)) 92 algo=algo))
92 defer.returnValue(algo) 93 defer.returnValue(algo)