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))