about summary refs log tree commit diff stats
path: root/src/event
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2022-10-21 13:24:46 +0200
committerMichael Vetter <jubalh@iodoru.org>2022-10-21 13:30:43 +0200
commit3bdc14dbcf1114fa1ea68cd6f455eecf90a9ac5e (patch)
tree714be508d95655b16565bc8431e44f5006c7e8c2 /src/event
parent980fc189cd19486102e7638bb5d03bfe0dd7be62 (diff)
parentd692aec32ed22377c34efd94845b3201b5a12217 (diff)
downloadprofani-tty-3bdc14dbcf1114fa1ea68cd6f455eecf90a9ac5e.tar.gz
Merge MAM improvements from #1724
I think this PR already solves and improves the MAM situation a lot.

What's @MarcoPolo-PasTonMolo still wanted to do in this branch is:
* MAM for mucs
* Check if url and quotes autocompletion works fine
* Check if the api still works fine
* Resolve conflicts

Conflicts are solved with this commit.

MAM for mucs can be another feature PR.

The rest we can check while being on master. And more people can help
testing.
Diffstat (limited to 'src/event')
-rw-r--r--src/event/server_events.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/event/server_events.c b/src/event/server_events.c
index df796448..98b1ac5d 100644
--- a/src/event/server_events.c
+++ b/src/event/server_events.c
@@ -55,6 +55,7 @@
 #include "event/common.h"
 #include "plugins/plugins.h"
 #include "ui/window_list.h"
+#include "ui/window.h"
 #include "tools/bookmark_ignore.h"
 #include "xmpp/xmpp.h"
 #include "xmpp/muc.h"
@@ -648,6 +649,11 @@ sv_ev_incoming_message(ProfMessage* message)
         chatwin = (ProfChatWin*)window;
         new_win = TRUE;
 
+        if (prefs_get_boolean(PREF_MAM)) {
+            win_print_loading_history(window);
+            iq_mam_request(chatwin, g_date_time_add_seconds(message->timestamp, 0)); // copy timestamp
+        }
+
 #ifdef HAVE_OMEMO
         if (!message->is_mam) {
             if (omemo_automatic_start(message->from_jid->barejid)) {