aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/message_processor.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2018-02-28 21:02:39 +0100
committerfiaxh <git@mx.ax.lt>2018-03-06 21:55:31 +0100
commit0968da1ff76e7443c2590f4182087bb501d9c8f5 (patch)
tree9c85aaf44bb53386ddb4fc50de8addfe9bf0f3ae /libdino/src/service/message_processor.vala
parenta8ee61b34c4c6c73cda94ac5f60529e892b3666b (diff)
downloaddino-0968da1ff76e7443c2590f4182087bb501d9c8f5.tar.gz
dino-0968da1ff76e7443c2590f4182087bb501d9c8f5.zip
Only notify on last MAM message, only if not read
fixes #293
Diffstat (limited to 'libdino/src/service/message_processor.vala')
-rw-r--r--libdino/src/service/message_processor.vala5
1 files changed, 4 insertions, 1 deletions
diff --git a/libdino/src/service/message_processor.vala b/libdino/src/service/message_processor.vala
index 01050631..9a20cf3f 100644
--- a/libdino/src/service/message_processor.vala
+++ b/libdino/src/service/message_processor.vala
@@ -13,6 +13,7 @@ public class MessageProcessor : StreamInteractionModule, Object {
public signal void build_message_stanza(Entities.Message message, Xmpp.MessageStanza message_stanza, Conversation conversation);
public signal void pre_message_send(Entities.Message message, Xmpp.MessageStanza message_stanza, Conversation conversation);
public signal void message_sent(Entities.Message message, Conversation conversation);
+ public signal void history_synced(Account account);
public MessageListenerHolder received_pipeline = new MessageListenerHolder();
@@ -66,7 +67,9 @@ public class MessageProcessor : StreamInteractionModule, Object {
});
stream_interactor.module_manager.get_module(account, Xmpp.Xep.MessageArchiveManagement.Module.IDENTITY).feature_available.connect( (stream) => {
DateTime start_time = account.mam_earliest_synced.to_unix() > 60 ? account.mam_earliest_synced.add_minutes(-1) : account.mam_earliest_synced;
- stream.get_module(Xep.MessageArchiveManagement.Module.IDENTITY).query_archive(stream, null, start_time, null);
+ stream.get_module(Xep.MessageArchiveManagement.Module.IDENTITY).query_archive(stream, null, start_time, null, () => {
+ history_synced(account);
+ });
});
}