comparison sat/plugins/plugin_xep_0313.py @ 3356:569f4cf7183b

plugin XEP-0313: fixed `MAMGet` signature
author Goffi <goffi@goffi.org>
date Thu, 17 Sep 2020 10:46:13 +0200
parents 384283adcce1
children 40794e658d68
comparison
equal deleted inserted replaced
3355:33d9b38b5890 3356:569f4cf7183b
67 # Deferred used to store last stanza id in order of reception 67 # Deferred used to store last stanza id in order of reception
68 self._last_stanza_id_d = defer.Deferred() 68 self._last_stanza_id_d = defer.Deferred()
69 self._last_stanza_id_d.callback(None) 69 self._last_stanza_id_d.callback(None)
70 host.bridge.addMethod( 70 host.bridge.addMethod(
71 "MAMGet", ".plugin", in_sign='sss', 71 "MAMGet", ".plugin", in_sign='sss',
72 out_sign='(a(sdssa{ss}a{ss}sa{ss})a{ss}s)', method=self._getArchives, 72 out_sign='(a(sdssa{ss}a{ss}ss)ss)', method=self._getArchives,
73 async_=True) 73 async_=True)
74 74
75 @defer.inlineCallbacks 75 @defer.inlineCallbacks
76 def resume(self, client): 76 def resume(self, client):
77 """Retrieve one2one messages received since the last we have in local storage""" 77 """Retrieve one2one messages received since the last we have in local storage"""
329 mess_list.append(client.messageGetBridgeArgs(mess_data)) 329 mess_list.append(client.messageGetBridgeArgs(mess_data))
330 metadata = { 330 metadata = {
331 'rsm': self._rsm.response2dict(rsm_response), 331 'rsm': self._rsm.response2dict(rsm_response),
332 'mam': mam_response 332 'mam': mam_response
333 } 333 }
334 return mess_list, metadata, client.profile 334 return mess_list, data_format.serialise(metadata), client.profile
335 335
336 def _getArchives(self, service, extra_ser, profile_key): 336 def _getArchives(self, service, extra_ser, profile_key):
337 """ 337 """
338 @return: tuple with: 338 @return: tuple with:
339 - list of message with same data as in bridge.messageNew 339 - list of message with same data as in bridge.messageNew