changeset 59:2f2b2f536008

wokkel/mam: added "attributes" dict in onArchiveRequest return value, so <fin/> attributes can be specified
author Goffi <goffi@goffi.org>
date Sat, 12 Jan 2019 16:39:40 +0100
parents f4d569dc8e6b
children 938c740d31fe
files sat_tmp/wokkel/mam.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/sat_tmp/wokkel/mam.py	Sun Jan 06 17:25:30 2019 +0100
+++ b/sat_tmp/wokkel/mam.py	Sat Jan 12 16:39:40 2019 +0100
@@ -495,9 +495,9 @@
         """
         Called when a message archive request has been received.
 
-        This replies with the list of archived message and the <iq> result
-        @return: A tuple with list of message data (id, element, data) and RSM element
-        @rtype: C{tuple}
+        This will send the list of archived message and return MAM <fin> element
+        @return: The MAM <fin> element
+        @rtype: L{Element<twisted.words.xish.domish.Element>}
         """
         iq.handled = True
         mam_ = self._request_class.fromElement(iq)
@@ -525,11 +525,13 @@
             self.xmlstream.send(msg)
 
         def cb(result):
-            msg_data, rsm_elt = result
+            msg_data, rsm_elt, attributes = result
             for data in msg_data:
                 forwardMessage(*data)
 
             fin_elt = domish.Element((NS_MAM, 'fin'))
+            for key, value in attributes.items():
+                fin_elt[key] = value
 
             if rsm_elt is not None:
                 fin_elt.addChild(rsm_elt)