summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0313
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2013-09-12 10:52:15 -0700
committerLance Stout <lancestout@gmail.com>2013-09-12 10:52:15 -0700
commita2784be4d6e3a66f17fc46cf8e20fe35cc0b6193 (patch)
tree9ac44296a4014e56b09888083b5cae5952cb946a /sleekxmpp/plugins/xep_0313
parentad7a57103d2d85a198bc0bf2d30d24a86ca17958 (diff)
downloadslixmpp-a2784be4d6e3a66f17fc46cf8e20fe35cc0b6193.tar.gz
slixmpp-a2784be4d6e3a66f17fc46cf8e20fe35cc0b6193.tar.bz2
slixmpp-a2784be4d6e3a66f17fc46cf8e20fe35cc0b6193.tar.xz
slixmpp-a2784be4d6e3a66f17fc46cf8e20fe35cc0b6193.zip
Add MAM archived tags
Diffstat (limited to 'sleekxmpp/plugins/xep_0313')
-rw-r--r--sleekxmpp/plugins/xep_0313/mam.py1
-rw-r--r--sleekxmpp/plugins/xep_0313/stanza.py14
2 files changed, 15 insertions, 0 deletions
diff --git a/sleekxmpp/plugins/xep_0313/mam.py b/sleekxmpp/plugins/xep_0313/mam.py
index dbff46a2..4b82ca03 100644
--- a/sleekxmpp/plugins/xep_0313/mam.py
+++ b/sleekxmpp/plugins/xep_0313/mam.py
@@ -36,6 +36,7 @@ class XEP_0313(BasePlugin):
register_stanza_plugin(Iq, stanza.MAM)
register_stanza_plugin(Iq, stanza.Preferences)
register_stanza_plugin(Message, stanza.Result)
+ register_stanza_plugin(Message, stanza.Archived, iterable=True)
register_stanza_plugin(stanza.Result, self.xmpp['xep_0297'].stanza.Forwarded)
register_stanza_plugin(stanza.MAM, self.xmpp['xep_0059'].stanza.Set)
diff --git a/sleekxmpp/plugins/xep_0313/stanza.py b/sleekxmpp/plugins/xep_0313/stanza.py
index 476cbbfb..b7def47b 100644
--- a/sleekxmpp/plugins/xep_0313/stanza.py
+++ b/sleekxmpp/plugins/xep_0313/stanza.py
@@ -123,3 +123,17 @@ class Result(ElementBase):
namespace = 'urn:xmpp:mam:tmp'
plugin_attrib = 'mam_result'
interfaces = set(['queryid', 'id'])
+
+
+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))