From c3532bdf3141bcf0cbf9e4ae7a926dcda4f132ef Mon Sep 17 00:00:00 2001 From: fiaxh Date: Wed, 18 Dec 2019 18:53:14 +0100 Subject: Refactor MAM catchup. Fetch from latest to earliest message. --- xmpp-vala/src/module/message/module.vala | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xmpp-vala/src/module/message') diff --git a/xmpp-vala/src/module/message/module.vala b/xmpp-vala/src/module/message/module.vala index ab3a7d80..5ddbbe1a 100644 --- a/xmpp-vala/src/module/message/module.vala +++ b/xmpp-vala/src/module/message/module.vala @@ -12,6 +12,7 @@ namespace Xmpp { public StanzaListenerHolder send_pipeline = new StanzaListenerHolder(); public signal void received_message(XmppStream stream, MessageStanza message); + public signal void received_message_unprocessed(XmppStream stream, MessageStanza message); public void send_message(XmppStream stream, MessageStanza message) { send_pipeline.run.begin(stream, message, (obj, res) => { @@ -21,6 +22,9 @@ namespace Xmpp { public async void received_message_stanza_async(XmppStream stream, StanzaNode node) { MessageStanza message = new MessageStanza.from_stanza(node, stream.get_flag(Bind.Flag.IDENTITY).my_jid); + + received_message_unprocessed(stream, message); + if (!message.is_error()) { bool abort = yield received_pipeline.run(stream, message); if (abort) return; -- cgit v1.2.3-70-g09d2