From 64964d04159af25ca43965f7efa7eaef9a2eb1ab Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Sat, 29 Aug 2020 21:14:06 +0200 Subject: [PATCH] Also check date on outgoing/incoming messages So the first thing that happens will trigger it. --- src/ui/chatwin.c | 9 +++++++-- src/ui/mucwin.c | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c index 74f4f44e..5eb1e403 100644 --- a/src/ui/chatwin.c +++ b/src/ui/chatwin.c @@ -357,10 +357,13 @@ chatwin_outgoing_msg(ProfChatWin* chatwin, const char* const message, char* id, enc_char = strdup("-"); } + ProfWin* window = (ProfWin*)chatwin; + win_changed_date_since_last_msg(window); + if (request_receipt && id) { - win_print_outgoing_with_receipt((ProfWin*)chatwin, enc_char, "me", message, id, replace_id); + win_print_outgoing_with_receipt(window, enc_char, "me", message, id, replace_id); } else { - win_print_outgoing((ProfWin*)chatwin, enc_char, id, replace_id, message); + win_print_outgoing(window, enc_char, id, replace_id, message); } free(enc_char); @@ -387,6 +390,8 @@ chatwin_outgoing_carbon(ProfChatWin* chatwin, ProfMessage* message) ProfWin* window = (ProfWin*)chatwin; + win_changed_date_since_last_msg(window); + win_print_outgoing(window, enc_char, message->id, message->replace_id, message->plain); int num = wins_get_num(window); status_bar_active(num, WIN_CHAT, chatwin->barejid); diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c index 004e19bc..a9ebc6da 100644 --- a/src/ui/mucwin.c +++ b/src/ui/mucwin.c @@ -501,7 +501,8 @@ mucwin_outgoing_msg(ProfMucWin* mucwin, const char* const message, const char* c assert(mucwin != NULL); ProfWin* window = (ProfWin*)mucwin; - char* mynick = muc_nick(mucwin->roomjid); + + win_changed_date_since_last_msg(window); // displayed message char char* ch; @@ -519,6 +520,7 @@ mucwin_outgoing_msg(ProfMucWin* mucwin, const char* const message, const char* c ch = strdup("-"); } + char* mynick = muc_nick(mucwin->roomjid); win_print_outgoing_muc_msg(window, ch, mynick, id, replace_id, message); free(ch);