From b64411a3f9025820dadc92b666d15659ea7cb0bc Mon Sep 17 00:00:00 2001 From: MarcoPolo-PasTonMolo Date: Tue, 14 Feb 2023 00:25:11 +0200 Subject: Fix MAM not loading some recent messages Reverse a small change from commit e886ba0 that caused this issue. Fixes https://github.com/profanity-im/profanity/issues/1790 --- src/xmpp/iq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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(); -- cgit 1.4.1-2-gfad0