diff options
author | Lance Stout <lancestout@gmail.com> | 2011-10-05 12:09:50 -0400 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-10-05 12:09:50 -0400 |
commit | 3e384d3cfe3c27e6825a6c6827dda732974e9b50 (patch) | |
tree | ab130b5edf5bfe342eb3a67266853d99bfa2ebb6 /sleekxmpp/plugins/xep_0009/binding.py | |
parent | e33949c3977f4ee6889abae7a80e5d365ae66bda (diff) | |
download | slixmpp-3e384d3cfe3c27e6825a6c6827dda732974e9b50.tar.gz slixmpp-3e384d3cfe3c27e6825a6c6827dda732974e9b50.tar.bz2 slixmpp-3e384d3cfe3c27e6825a6c6827dda732974e9b50.tar.xz slixmpp-3e384d3cfe3c27e6825a6c6827dda732974e9b50.zip |
XEP-0009 will likely be updated to use <base64 /> instead of <Base64 />
Both are supported when reading, but <base64 /> will be used for output.
Diffstat (limited to 'sleekxmpp/plugins/xep_0009/binding.py')
-rw-r--r-- | sleekxmpp/plugins/xep_0009/binding.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sleekxmpp/plugins/xep_0009/binding.py b/sleekxmpp/plugins/xep_0009/binding.py index 30f02d36..ef34b580 100644 --- a/sleekxmpp/plugins/xep_0009/binding.py +++ b/sleekxmpp/plugins/xep_0009/binding.py @@ -63,7 +63,7 @@ def _py2xml(*args): double.text = str(x) val.append(double) elif type(x) is rpcbase64: - b64 = ET.Element("Base64") + b64 = ET.Element("base64") b64.text = x.encoded() val.append(b64) elif type(x) is rpctime: @@ -110,7 +110,10 @@ def _xml2py(value): return value.find('{%s}string' % namespace).text if value.find('{%s}double' % namespace) is not None: return float(value.find('{%s}double' % namespace).text) + if value.find('{%s}base64') is not None: + return rpcbase64(value.find('base64' % namespace).text) if value.find('{%s}Base64') is not None: + # Older versions of XEP-0009 used Base64 return rpcbase64(value.find('Base64' % namespace).text) if value.find('{%s}dateTime.iso8601') is not None: return rpctime(value.find('{%s}dateTime.iso8601')) |