-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api: Add Message::new_text() (#6123)
This adds a function to `Message`: ```rust pub fn new_text(text: String) -> Self { Message { viewtype: Viewtype::Text, text, ..Default::default() } } ``` I keep expecting that a function like this must exist and being surprised that it doesn't. Open question is whether it should be `pub` or `pub(crate)` - I made it `pub` for now because it may be useful for others and we currently we aren't thinking about the Rust API that much, anyway, but I can make it `pub(crate)`, too (then it can't be used in deltachat-jsonrpc and deltachat-repl). I replaced some usages of Message::new(Viewtype::Text), but not all yet, I'm going to do this in a follow-up, which will remove another around 65 LOC.
- Loading branch information
Showing
4 changed files
with
35 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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 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 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 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