refactor(mimefactory): add Encryption enum - #8573
Conversation
f0f1d06 to
d0a6268
Compare
hpk42
left a comment
There was a problem hiding this comment.
A good refactoring although it's a bit hard to know if it fully preserves behaviour especially around symmetric encryption -- it seems that should_encrypt_with_broadcast_secret is not actually used anymore.
| // created before we had symmetric encryption, | ||
| // we show an error message. | ||
| let text = BROADCAST_INCOMPATIBILITY_MSG; | ||
| chat::add_info_msg(context, chat.id, text).await?; |
There was a problem hiding this comment.
this adds a message to the DB which is a bit unexpected for the from_msg loader function returning a MimeFactory.
There was a problem hiding this comment.
Maybe the message can be removed completely, it was for the old broadcast lists. Users should have migrated to channels by now.
5799581 to
d1c9112
Compare
It is used via |
27ef86d to
229da34
Compare
|
still not convinced about renaming |
Creating QR code or sending a message will still fail with a shorter error, but no info message will be created anymore. Most users should have migrated the channels by recreating them by now. This change is needed for moving loading of the shared secret to earlier stages of message preparation, otherwise mimefactory will have to create these info messages when loading the message into memory.
This replaces independent data structures which allowed invalid state of having both the public keys and the shared secret, or having a shared secret but not encrypting the message because encryption_pubkeys was None instead of Some(Vec::new()).
229da34 to
aa02cd3
Compare
|
|
|
right, the bodies were aliases from the start. Before this PR, still my will-be-encrypted rename-comment is open. |
|
i like the new Encryption enum variants better btw :) |
I already removed local variable renames. |
|
ah great, github-refresh shows it now. |
This replaces independent data structures
which allowed invalid state of having both the public keys and the shared secret, or having a shared secret
but not encrypting the message because encryption_pubkeys was None instead of Some(Vec::new()).