muc: save oldest timestamp
So far we saved the timestamp which also had the `from`.
But we need this only to find out whether it's MUC history.
For displaying we should use the oldest delay timestamp.
Also in
61f66966dd (diff-4926fd4577a336bd3eb240f8104a5c5bL837)
a error was introduced.
Before we saved the timestamp in all cases. And only if timestamp AND
from was given we went into MUC history case.
Normal timestamp saving was not done anymore only if it also had a from
attribute.
Regards https://github.com/profanity-im/profanity/issues/1254
This commit is contained in:
@@ -831,14 +831,19 @@ _handle_groupchat(xmpp_stanza_t *const stanza)
|
||||
message->plain = strdup(message->body);
|
||||
}
|
||||
|
||||
// determine if the notifications happened whilst offline
|
||||
// determine if the notifications happened whilst offline (MUC history)
|
||||
message->timestamp = stanza_get_delay_from(stanza, jid->barejid);
|
||||
if (message->timestamp == NULL) {
|
||||
// checking the domainpart is a workaround for some prosody versions (gh#1190)
|
||||
message->timestamp = stanza_get_delay_from(stanza, jid->domainpart);
|
||||
}
|
||||
|
||||
if (message->timestamp) {
|
||||
bool is_muc_history = message->timestamp != NULL;
|
||||
|
||||
// we want to display the oldest delay
|
||||
message->timestamp = stanza_get_oldest_delay(stanza);
|
||||
|
||||
if (is_muc_history) {
|
||||
sv_ev_room_history(message);
|
||||
} else {
|
||||
sv_ev_room_message(message);
|
||||
|
||||
Reference in New Issue
Block a user