diff options
author | MarcoPolo-PasTonMolo <marcopolopastonmolo@protonmail.com> | 2022-08-20 22:48:02 +0300 |
---|---|---|
committer | MarcoPolo-PasTonMolo <marcopolopastonmolo@protonmail.com> | 2022-08-20 22:48:02 +0300 |
commit | a704838152b9aec0bef2446f742b1eb548f71d1a (patch) | |
tree | aed0eba30c8f27cb4f310b66752cd2fee30ba776 /src/ui | |
parent | 4b9ff6d4dcf2e1c16f12f9039d57530245ce1c4d (diff) | |
download | profani-tty-a704838152b9aec0bef2446f742b1eb548f71d1a.tar.gz |
Handle late delivery
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/chatwin.c | 10 | ||||
-rw-r--r-- | src/ui/window.c | 1 |
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); } |