From a2784be4d6e3a66f17fc46cf8e20fe35cc0b6193 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Thu, 12 Sep 2013 10:52:15 -0700 Subject: Add MAM archived tags --- sleekxmpp/plugins/xep_0313/mam.py | 1 + sleekxmpp/plugins/xep_0313/stanza.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+) 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)) -- cgit v1.2.3