1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Add timestamp for incoming messages if none is set

Timestamps are only set if a message is delayed.
If none is set let's set it upon recaival so we don't have to set it
when it gets displayed.

This means we will also have it for logs etc in the ProfMessage.
This commit is contained in:
Michael Vetter 2020-03-19 13:38:17 +01:00
parent 8045a32c4a
commit d1d0ad8d1a

View File

@ -1009,6 +1009,8 @@ _handle_muc_private_message(xmpp_stanza_t *const stanza)
if (message->timestamp) {
sv_ev_delayed_private_message(message);
} else {
message->timestamp = g_date_time_new_now_local();
sv_ev_incoming_private_message(message);
}
@ -1199,6 +1201,10 @@ _handle_chat(xmpp_stanza_t *const stanza)
}
message->timestamp = stanza_get_delay(stanza);
if (!message->timestamp) {
message->timestamp = g_date_time_new_now_local();
}
if (body) {
message->body = xmpp_stanza_get_text(body);
}