refactor!: DecryptedMessage is an enum - #2376
Merged
Merged
Conversation
SimonThormeyer
force-pushed
the
simon/refactor/decrypted-message-enums
branch
5 times, most recently
from
July 27, 2026 15:37
752c5b9 to
aece599
Compare
SimonThormeyer
marked this pull request as ready for review
July 28, 2026 06:52
fewerner
approved these changes
Jul 28, 2026
fewerner
left a comment
Contributor
There was a problem hiding this comment.
Nice improvement, I like it!
SimonThormeyer
force-pushed
the
simon/refactor/decrypted-message-enums
branch
2 times, most recently
from
July 28, 2026 11:56
dbb907d to
973a169
Compare
coriolinus
approved these changes
Jul 28, 2026
| let decrypted = match message.into_content() { | ||
| ProcessedMessageContent::ApplicationMessage(app_msg) => { | ||
| let conversation = self; | ||
| let sender_client_id = sender_client_id_result?; |
Contributor
There was a problem hiding this comment.
Only propagate sender_client_id_result's error in the event it was an application message, right? Any reason not to move its parsing here?
Member
Author
There was a problem hiding this comment.
Not sure if parsing the message above is strictly necessary, however, message.into_content() (3 lines above) moves message, and producing sender_client_id_result requires borrowing it (via message.credential()), so we have to do it before if we're not working around that in another way.
Member
Author
There was a problem hiding this comment.
I added a comment in the place we produce sender_client_id_result.
SimonThormeyer
force-pushed
the
simon/refactor/decrypted-message-enums
branch
4 times, most recently
from
July 29, 2026 12:01
eee3d67 to
42025d3
Compare
…mit processing We're processing a commit, so a commit delay is superfluous. This returns `None` whenever it is called here, because there are no pending proposals.
This reduces boilerplate when dealing with enums, like the upcoming `DecryptedMessage`.
The relevant data returned from `decrypt_message()` has three different variants, depending on whether the message is - Text - a Commit - a Proposal
SimonThormeyer
force-pushed
the
simon/refactor/decrypted-message-enums
branch
from
July 29, 2026 12:09
42025d3 to
73a86e1
Compare
SimonThormeyer
force-pushed
the
simon/refactor/decrypted-message-enums
branch
from
July 29, 2026 12:15
73a86e1 to
dce7c71
Compare
SimonThormeyer
force-pushed
the
simon/refactor/decrypted-message-enums
branch
from
July 29, 2026 12:19
dce7c71 to
2499b55
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This changes the
DecryptedMessagestruct to an enum in both ffi crate and crypto crate.