-
-
Notifications
You must be signed in to change notification settings - Fork 106
Various protected group changes #7146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
505b41d
feat: do not set "unknown sender for this chat" error
link2xt e1cbdf4
fix: add "Messages are end-to-end encrypted." to non-protected groups
link2xt 451e33d
test: add TestContext.create_chat_id
link2xt 9e40718
api!: remove `is_profile_verified` APIs
link2xt b53921b
api!: remove deprecated is_protection_broken
link2xt 04eda07
feat: do not replace messages with an error on verification failure
link2xt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1693,12 +1693,6 @@ async fn add_parts( | |
let name: &str = from.display_name.as_ref().unwrap_or(&from.addr); | ||
for part in &mut mime_parser.parts { | ||
part.param.set(Param::OverrideSenderDisplayname, name); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This usage of |
||
|
||
if chat.is_protected() { | ||
// In protected chat, also mark the message with an error. | ||
let s = stock_str::unknown_sender_for_chat(context).await; | ||
part.error = Some(s); | ||
} | ||
} | ||
} | ||
} | ||
|
@@ -1870,25 +1864,6 @@ async fn add_parts( | |
None | ||
}; | ||
|
||
let mut verification_failed = false; | ||
if !chat_id.is_special() && is_partial_download.is_none() { | ||
// For outgoing emails in the 1:1 chat we have an exception that | ||
// they are allowed to be unencrypted: | ||
// 1. They can't be an attack (they are outgoing, not incoming) | ||
// 2. Probably the unencryptedness is just a temporary state, after all | ||
// the user obviously still uses DC | ||
// -> Showing info messages every time would be a lot of noise | ||
// 3. The info messages that are shown to the user ("Your chat partner | ||
// likely reinstalled DC" or similar) would be wrong. | ||
if chat.is_protected() && (mime_parser.incoming || chat.typ != Chattype::Single) { | ||
if let VerifiedEncryption::NotVerified(err) = verified_encryption { | ||
verification_failed = true; | ||
warn!(context, "Verification problem: {err:#}."); | ||
let s = format!("{err}. Re-download the message or see 'Info' for more details"); | ||
mime_parser.replace_msg_by_error(&s); | ||
} | ||
} | ||
} | ||
drop(chat); // Avoid using stale `chat` object. | ||
|
||
let sort_timestamp = tweak_sort_timestamp( | ||
|
@@ -2162,10 +2137,6 @@ RETURNING id | |
DownloadState::Available | ||
} else if mime_parser.decrypting_failed { | ||
DownloadState::Undecipherable | ||
} else if verification_failed { | ||
// Verification can fail because of message reordering. Re-downloading the | ||
// message should help if so. | ||
DownloadState::Available | ||
} else { | ||
DownloadState::Done | ||
}, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -634,7 +634,7 @@ async fn test_unknown_sender() -> Result<()> { | |
// The message from Bob is delivered late, Bob is already removed. | ||
let msg = alice.recv_msg(&sent).await; | ||
assert_eq!(msg.text, "Hi hi!"); | ||
assert_eq!(msg.error.unwrap(), "Unknown sender for this chat."); | ||
assert_eq!(msg.get_override_sender_name().unwrap(), "[email protected]"); | ||
|
||
Ok(()) | ||
} | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this happen now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually cannot happen to key-contacts. We should remove this setting, it is only used in
get_info()
for logging its value.