about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/chatwin.c10
-rw-r--r--src/ui/window.c1
2 files changed, 5 insertions, 6 deletions
diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c
index 7d583b43..fbb5183f 100644
--- a/src/ui/chatwin.c
+++ b/src/ui/chatwin.c
@@ -98,7 +98,7 @@ chatwin_new(const char* const barejid)
 #endif // HAVE_OMEMO
 
     if (prefs_get_boolean(PREF_MAM)) {
-        iq_mam_request(chatwin);
+        iq_mam_request(chatwin, NULL);
         win_print_loading_history(window);
     }
 
@@ -320,10 +320,7 @@ chatwin_incoming_msg(ProfChatWin* chatwin, ProfMessage* message, gboolean win_cr
         }
 
         win_insert_last_read_position_marker((ProfWin*)chatwin, chatwin->barejid);
-
-        if (!win_created || !prefs_get_boolean(PREF_MAM)) {
-            win_print_incoming(window, display_name, message);
-        }
+        win_print_incoming(window, display_name, message);
     }
 
     wins_add_urls_ac(window, message);
@@ -542,7 +539,8 @@ _chatwin_history(ProfChatWin* chatwin, const char* const contact_barejid)
 }
 
 // Print history starting from start_time to end_time if end_time is null the
-// first entrie's timestamp in the buffer is used. Flip true to prepend to buffer.
+// first entry's timestamp in the buffer is used. Flip true to prepend to buffer.
+// Timestamps should be in iso8601
 gboolean
 chatwin_db_history(ProfChatWin* chatwin, char* start_time, char* end_time, gboolean flip)
 {
diff --git a/src/ui/window.c b/src/ui/window.c
index 4ac45f9c..0470b3de 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -1869,6 +1869,7 @@ win_print_loading_history(ProfWin* window)
 {
     GDateTime* timestamp = buffer_size(window->layout->buffer) != 0 ? buffer_get_entry(window->layout->buffer, 0)->time : g_date_time_new_now_local();
     buffer_prepend(window->layout->buffer, "-", 0, timestamp, NO_DATE, THEME_ROOMINFO, NULL, NULL, LOADING_MESSAGE, NULL, NULL);
+    g_date_time_unref(timestamp);
     win_redraw(window);
 }