Skip to content

Commit

Permalink
Save first delay tag as timestamp
Browse files Browse the repository at this point in the history
So far we got the first delay with a from that comes from the server.
This way we know it's MUC history.

Now we take the first time stamp we actually find. Which is likely the
one being added first. And should contain the correct time to display.

It would be nicer to actually compare the dates though.

Regards #1254
  • Loading branch information
jubalh committed Jan 24, 2020
1 parent 663aa09 commit ef00b10
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/xmpp/message.c
Expand Up @@ -838,6 +838,15 @@ _handle_groupchat(xmpp_stanza_t *const stanza)
message->timestamp = stanza_get_delay_from(stanza, jid->domainpart);
}

// Above we check whether the timestamps come from the server. So we know it
// is MUC history.
// Now we actually save the first timestamp we can find, since this is likely
// the first one being added. So the time should actually be right one to display.
// TODO: properly compare the dates
if (message->timestamp) {
message->timestamp = stanza_get_delay(stanza);
}

if (message->timestamp) {
sv_ev_room_history(message);
} else {
Expand Down

0 comments on commit ef00b10

Please sign in to comment.