about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2023-02-15 15:18:08 +0100
committerGitHub <noreply@github.com>2023-02-15 15:18:08 +0100
commit89b0744628b9c74b0d9725415b1d081e71a2b2a8 (patch)
tree0f7f35575117852ef6bf186cf62c08e647581562
parent11055715845d7d7e5d3ef42982d04d1b65d57ac2 (diff)
parentb64411a3f9025820dadc92b666d15659ea7cb0bc (diff)
downloadprofani-tty-89b0744628b9c74b0d9725415b1d081e71a2b2a8.tar.gz
Merge pull request #1791 from MarcoPolo-PasTonMolo/fix/MAM_not_loading_recent_messages
Fix MAM not loading some recent messages
-rw-r--r--src/xmpp/iq.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index e6c1f6dc..56169d77 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -2660,15 +2660,15 @@ _iq_mam_request(ProfChatWin* win, GDateTime* startdate, GDateTime* enddate)
         startdate_str = g_date_time_format(startdate, mam_timestamp_format_string);
         fetch_next = TRUE;
         g_date_time_unref(startdate);
+    } else if (!enddate) {
+        GDateTime* now = g_date_time_new_now_utc();
+        enddate_str = g_date_time_format(now, mam_timestamp_format_string);
+        g_date_time_unref(now);
     }
 
     if (enddate) {
         enddate_str = g_date_time_format(enddate, mam_timestamp_format_string);
         g_date_time_unref(enddate);
-    } else {
-        GDateTime* now = g_date_time_new_now_utc();
-        enddate_str = g_date_time_format(now, mam_timestamp_format_string);
-        g_date_time_unref(now);
     }
 
     xmpp_ctx_t* const ctx = connection_get_ctx();