summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0313/stanza.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/plugins/xep_0313/stanza.py')
-rw-r--r--sleekxmpp/plugins/xep_0313/stanza.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/sleekxmpp/plugins/xep_0313/stanza.py b/sleekxmpp/plugins/xep_0313/stanza.py
index a33c2e35..81576cd4 100644
--- a/sleekxmpp/plugins/xep_0313/stanza.py
+++ b/sleekxmpp/plugins/xep_0313/stanza.py
@@ -25,13 +25,13 @@ class MAM(ElementBase):
self._results = []
def get_start(self):
- timestamp = self._get_attr('start')
+ timestamp = self._get_sub_text('start')
return xep_0082.parse(timestamp)
def set_start(self, value):
if isinstance(value, dt.datetime):
value = xep_0082.format_datetime(value)
- self._set_attr('start', value)
+ self._set_sub_text('start', value)
def get_end(self):
timestamp = self._get_sub_text('end')
@@ -122,10 +122,18 @@ class Result(ElementBase):
name = 'result'
namespace = 'urn:xmpp:mam:tmp'
plugin_attrib = 'mam_result'
- interfaces = set(['forwarded', 'queryid', 'id'])
+ interfaces = set(['queryid', 'id'])
- def get_forwarded(self):
- return self.parent()['forwarded']
- def del_forwarded(self):
- del self.parent()['forwarded']
+class Archived(ElementBase):
+ name = 'archived'
+ namespace = 'urn:xmpp:mam:tmp'
+ plugin_attrib = 'mam_archived'
+ plugin_multi_attrib = 'mam_archives'
+ interfaces = set(['by', 'id'])
+
+ def get_by(self):
+ return JID(self._get_attr('by'))
+
+ def set_by(self):
+ return self._set_attr('by', str(value))