diff options
author | Jefry Lagrange <jefry.reyes@gmail.com> | 2012-05-29 02:07:52 +0400 |
---|---|---|
committer | Jefry Lagrange <jefry.reyes@gmail.com> | 2012-05-29 02:07:52 +0400 |
commit | ae4596bd2e2d6433f6d0f717de340f1ca5923686 (patch) | |
tree | 41df6e80346907a015bc33ef05b5ac8211c5cf83 /src/common/xmpp | |
parent | e8df81ab31814da1cbd6b3793271644d39d8656c (diff) |
update xep300 to version 1
Diffstat (limited to 'src/common/xmpp')
-rw-r--r-- | src/common/xmpp/protocol.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/common/xmpp/protocol.py b/src/common/xmpp/protocol.py index e0bd794a3..daac07278 100644 --- a/src/common/xmpp/protocol.py +++ b/src/common/xmpp/protocol.py @@ -162,7 +162,7 @@ NS_PUBKEY_PUBKEY = 'urn:xmpp:pubkey:2' NS_PUBKEY_REVOKE = 'urn:xmpp:revoke:2' NS_PUBKEY_ATTEST = 'urn:xmpp:attest:2' NS_STREAM_MGMT = 'urn:xmpp:sm:2' # XEP-198 -NS_HASHES = 'urn:xmpp:hashes:0' # XEP-300 +NS_HASHES = 'urn:xmpp:hashes:1' # XEP-300 NS_HASHES_MD5 = 'urn:xmpp:hash-function-textual-names:md5' NS_HASHES_SHA1 = 'urn:xmpp:hash-function-textual-names:sha-1' NS_HASHES_SHA256 = 'urn:xmpp:hash-function-textual-names:sha-256' @@ -1057,9 +1057,9 @@ class Hashes(Node): supported = ('md5', 'sha-1', 'sha-256', 'sha-512') def __init__(self, nsp=NS_HASHES): - Node.__init__(self, None, {}, [], None, None,False, None) + Node.__init__(self, None, {}, [], None, None, False, None) self.setNamespace(nsp) - self.setName('hashes') + self.setName('hash') def calculateHash(self, algo, file_string): """ @@ -1101,13 +1101,8 @@ class Hashes(Node): return hash_ def addHash(self, hash_, algo): - """ - More than one hash can be added. Although it is permitted, it should - not be done for big files because it could slow down Gajim. - """ - attrs = {} - attrs['algo'] = algo - self.addChild('hash', attrs, [hash_]) + self.setAttr('algo', algo) + self.setData(hash_) class Acks(Node): """ |