mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05: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:
parent
8045a32c4a
commit
d1d0ad8d1a
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user