Skip to content

feat(backwards-compat): For now, send Chat-Verified header (instead of _verified) again#7349

Merged
link2xt merged 5 commits intomainfrom
hoc/send-chat-verified-header
Oct 29, 2025
Merged

feat(backwards-compat): For now, send Chat-Verified header (instead of _verified) again#7349
link2xt merged 5 commits intomainfrom
hoc/send-chat-verified-header

Conversation

@Hocuri
Copy link
Copy Markdown
Collaborator

@Hocuri Hocuri commented Oct 24, 2025

Unfortunately, this means that for now, verifications are only gossiped in chats that already existed back when we had protected chats, and were protected back then. But this is only temporary; we will soon make this work again.

@Hocuri Hocuri requested a review from link2xt October 24, 2025 17:47
@Hocuri Hocuri force-pushed the hoc/send-chat-verified-header branch 2 times, most recently from 83892fc to 10d1481 Compare October 24, 2025 18:08
Comment on lines +1356 to +1362
let send_verified_headers = match chat.typ {
Chattype::Single => true,
Chattype::Group => true,
// Mailinglists and broadcast channels can actually never be verified:
Chattype::Mailinglist => false,
Chattype::OutBroadcast | Chattype::InBroadcast => false,
};
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code was copied from version 2.20.0

Comment on lines +1366 to +1369
.sql
.query_get_value("SELECT protected FROM chats WHERE id=?", (chat.id,))
.await?
.unwrap_or_default();
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code was also copied from version 2.20.0

Comment on lines +1375 to +1379
"SELECT COUNT(*)
FROM contacts, chats_contacts
WHERE chats_contacts.contact_id=contacts.id AND chats_contacts.chat_id=?
AND contacts.id>9
AND contacts.verifier=0",
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This SQL statement was largely copied from a SQL statement in stats.rs

Comment on lines +1384 to +1389
if !unverified_member_exists {
headers.push((
"Chat-Verified",
mail_builder::headers::raw::Raw::new("1").into(),
));
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code was also copied from version 2.20.0

@link2xt link2xt force-pushed the hoc/send-chat-verified-header branch from c8dc1a4 to ce0be05 Compare October 29, 2025 12:53
@link2xt link2xt changed the title [WIP] feat(backwards-compat): For now, send Chat-Verified header (instead of _verified) again feat(backwards-compat): For now, send Chat-Verified header (instead of _verified) again Oct 29, 2025
@link2xt link2xt merged commit 8b4c718 into main Oct 29, 2025
29 checks passed
@link2xt link2xt deleted the hoc/send-chat-verified-header branch October 29, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send Chat-Verified header in previously protected chats if all members are verified

2 participants