From 10315a245d7ed23ac9c915ecb298a484050ccef1 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sun, 23 Apr 2023 11:48:29 +0200 Subject: Code cleanup: Remove left-over usages of mam_earliest_synced --- libdino/src/service/database.vala | 1 + libdino/src/service/message_processor.vala | 24 ------------------------ 2 files changed, 1 insertion(+), 24 deletions(-) (limited to 'libdino/src/service') diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala index 6b3f5e6a..dc1d68f3 100644 --- a/libdino/src/service/database.vala +++ b/libdino/src/service/database.vala @@ -17,6 +17,7 @@ public class Database : Qlite.Database { public Column alias = new Column.Text("alias"); public Column enabled = new Column.BoolInt("enabled"); public Column roster_version = new Column.Text("roster_version") { min_version=2 }; + // no longer used. all usages already removed. remove db column at some point. public Column mam_earliest_synced = new Column.Long("mam_earliest_synced") { min_version=4 }; internal AccountTable(Database db) { diff --git a/libdino/src/service/message_processor.vala b/libdino/src/service/message_processor.vala index 2af68e2e..04c7d1a5 100644 --- a/libdino/src/service/message_processor.vala +++ b/libdino/src/service/message_processor.vala @@ -38,7 +38,6 @@ public class MessageProcessor : StreamInteractionModule, Object { received_pipeline.connect(new FilterMessageListener()); received_pipeline.connect(new StoreMessageListener(this, stream_interactor)); received_pipeline.connect(new StoreContentItemListener(stream_interactor)); - received_pipeline.connect(new MamMessageListener(stream_interactor)); stream_interactor.account_added.connect(on_account_added); @@ -365,29 +364,6 @@ public class MessageProcessor : StreamInteractionModule, Object { } } - private class MamMessageListener : MessageListener { - - public string[] after_actions_const = new string[]{ "DEDUPLICATE" }; - public override string action_group { get { return "MAM_NODE"; } } - public override string[] after_actions { get { return after_actions_const; } } - - private StreamInteractor stream_interactor; - - public MamMessageListener(StreamInteractor stream_interactor) { - this.stream_interactor = stream_interactor; - } - - public override async bool run(Entities.Message message, Xmpp.MessageStanza stanza, Conversation conversation) { - bool is_mam_message = Xmpp.MessageArchiveManagement.MessageFlag.get_flag(stanza) != null; - XmppStream? stream = stream_interactor.get_stream(conversation.account); - Xmpp.MessageArchiveManagement.Flag mam_flag = Xmpp.MessageArchiveManagement.Flag.get_flag(stream); - if (is_mam_message || (mam_flag != null && mam_flag.cought_up == true)) { - conversation.account.mam_earliest_synced = message.local_time; - } - return false; - } - } - public Entities.Message create_out_message(string text, Conversation conversation) { Entities.Message message = new Entities.Message(text); message.type_ = Util.get_message_type_for_conversation(conversation); -- cgit v1.2.3-70-g09d2