mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-25 21:46:22 +00:00
Check for correct delay tag for muc timestamps
https://github.com/profanity-im/profanity/issues/1190 had another issue: Sometimes servers send multiple </delay> and we just checked the first one we got and only used it if the 'from' attribute was fitting. However it could be that we actually wanted the second </delay> element and there the 'from' would have been right. So we need to loop through them until we get the one with the fitting 'from'. Fix https://github.com/profanity-im/profanity/issues/1190
This commit is contained in:
@@ -831,16 +831,17 @@ _handle_groupchat(xmpp_stanza_t *const stanza)
|
||||
}
|
||||
|
||||
// determine if the notifications happened whilst offline
|
||||
gchar *from;
|
||||
message->timestamp = stanza_get_delay_from(stanza, &from);
|
||||
// checking the domainpart is a workaround for some prosody versions (gh#1190)
|
||||
if (message->timestamp && (g_strcmp0(jid->barejid, from) == 0
|
||||
|| g_strcmp0(jid->domainpart, from) == 0)) {
|
||||
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) {
|
||||
sv_ev_room_history(message);
|
||||
} else {
|
||||
sv_ev_room_message(message);
|
||||
}
|
||||
g_free(from);
|
||||
|
||||
out:
|
||||
message_free(message);
|
||||
|
||||
Reference in New Issue
Block a user