xep_0231: Fix a traceback on result serialization.

This commit is contained in:
Emmanuel Gil Peyrot 2015-09-05 18:35:59 +01:00
parent 3978078710
commit 27f98bf22c
2 changed files with 3 additions and 4 deletions

View File

@ -134,8 +134,7 @@ class XEP_0231(BasePlugin):
def _get_bob(self, jid, node, ifrom, cid): def _get_bob(self, jid, node, ifrom, cid):
if cid in self._cids: if cid in self._cids:
return self._cids[cid] return self._cids[cid]
else: raise XMPPError('item-not-found')
raise XMPPError('item-not-found')
def _del_bob(self, jid, node, ifrom, cid): def _del_bob(self, jid, node, ifrom, cid):
if cid in self._cids: if cid in self._cids:

View File

@ -21,10 +21,10 @@ class BitsOfBinary(ElementBase):
interfaces = set(('cid', 'max_age', 'type', 'data')) interfaces = set(('cid', 'max_age', 'type', 'data'))
def get_max_age(self): def get_max_age(self):
return self._get_attr('max-age') return int(self._get_attr('max-age'))
def set_max_age(self, value): def set_max_age(self, value):
self._set_attr('max-age', value) self._set_attr('max-age', str(value))
def get_data(self): def get_data(self):
return base64.b64decode(bytes(self.xml.text)) return base64.b64decode(bytes(self.xml.text))