From 3e384d3cfe3c27e6825a6c6827dda732974e9b50 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 5 Oct 2011 12:09:50 -0400 Subject: [PATCH] XEP-0009 will likely be updated to use instead of Both are supported when reading, but will be used for output. --- sleekxmpp/plugins/xep_0009/binding.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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'))