From 27f98bf22c2b95b3aa39719fe7fed3db6506213a Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 5 Sep 2015 18:35:59 +0100 Subject: xep_0231: Fix a traceback on result serialization. --- slixmpp/plugins/xep_0231/bob.py | 3 +-- slixmpp/plugins/xep_0231/stanza.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/slixmpp/plugins/xep_0231/bob.py b/slixmpp/plugins/xep_0231/bob.py index b26eeede..a3b5edd4 100644 --- a/slixmpp/plugins/xep_0231/bob.py +++ b/slixmpp/plugins/xep_0231/bob.py @@ -134,8 +134,7 @@ class XEP_0231(BasePlugin): def _get_bob(self, jid, node, ifrom, cid): if cid in self._cids: return self._cids[cid] - else: - raise XMPPError('item-not-found') + raise XMPPError('item-not-found') def _del_bob(self, jid, node, ifrom, cid): if cid in self._cids: diff --git a/slixmpp/plugins/xep_0231/stanza.py b/slixmpp/plugins/xep_0231/stanza.py index f7e6a66c..b3b96eff 100644 --- a/slixmpp/plugins/xep_0231/stanza.py +++ b/slixmpp/plugins/xep_0231/stanza.py @@ -21,10 +21,10 @@ class BitsOfBinary(ElementBase): interfaces = set(('cid', 'max_age', 'type', 'data')) def get_max_age(self): - return self._get_attr('max-age') + return int(self._get_attr('max-age')) def set_max_age(self, value): - self._set_attr('max-age', value) + self._set_attr('max-age', str(value)) def get_data(self): return base64.b64decode(bytes(self.xml.text)) -- cgit v1.2.3