This return value was very complicated to understand. Some failure returns were returned as Err and some as Ok with no consistency, but resulting in the same behaviour. This refactor makes the handle_securejoin_handshake the sole place responsible for maintaining the state of the secure join process (context.bob) and also in charge of terminating the ongoing process. This is none of receive_imf's business. The remaining returns are now cleanly classified in application-errors and protocol errors: Applications errors result in an Err and mean there is a bug or something else serious went wrong, like database access suddenly failed or so. In this case receive_imf is still responsible for clearing the state and resetting ongoing-process. It may be possible this should still be moved back to securejoin.rs so that recieve_imf doesn't need to know anything about this either. Protocol errors are not failures for receive_imf, it just means the received message didn't follow the protocol. Receive_imf in this case is told to ignore the message: that is hide it but not delete it. Other Ok returns also only say what needs to happen to the message: - It's fully processed and needs no further processing, instead should be removed - It should still be processed as a normal received message. This changes some behaviour: if the chat creation/lookup for the contact fails this is treated as an application error. Previously this was silently ignored and send_msg() would be called with a 0 chat_id without checking the response. This resulted in the protocol quitely being blocked. This all shhould now make it easier to resultify more of the functions called by this function, instead of having to deal with very complicated application logic hidden in the return code.
Delta Chat Rust
Deltachat-core written in Rust
Installing Rust and Cargo
To download and install the official compiler for the Rust programming language, and the Cargo package manager, run the command in your user environment:
curl https://sh.rustup.rs -sSf | sh
Using the CLI client
Compile and run Delta Chat Core command line utility, using cargo:
cargo run --example repl -- /path/to/db
Configure your account (if not already configured):
Delta Chat Core is awaiting your commands.
> set addr your@email.org
> set mail_pw yourpassword
> configure
Connect to your mail server (if already configured):
> connect
Create a contact:
> addcontact yourfriends@email.org
Command executed successfully.
List contacts:
> listcontacts
Contact#10: <name unset> <yourfriends@email.org>
Contact#1: Me √√ <your@email.org>
Create a chat with your friend and send a message:
> createchat 10
Single#10 created successfully.
> chat 10
Single#10: yourfriends@email.org [yourfriends@email.org]
> send hi
Message sent.
If yourfriend@email.org uses DeltaChat, but does not receive message just
sent, it is advisable to check Spam folder. It is known that at least
gmx.com treat such test messages as spam, unless told otherwise with web
interface.
List messages when inside a chat:
> chat
For more commands type:
> help
Development
# run tests
$ cargo test --all
# build c-ffi
$ cargo build -p deltachat_ffi --release
Debugging environment variables
-
DCC_IMAP_DEBUG: if set IMAP protocol commands and responses will be printed -
DCC_MIME_DEBUG: if set outgoing and incoming message will be printed
Expensive tests
Some tests are expensive and marked with #[ignore], to run these
use the --ignored argument to the test binary (not to cargo itself):
$ cargo test -- --ignored
Features
vendored: When using Openssl for TLS, this bundles a vendored version.nightly: Enable nightly only performance and security related features.ringbuf: Enable the use ofslice_dequein pgp.
Language bindings and frontend projects
Language bindings are available for:
The following "frontend" projects make use of the Rust-library or its language bindings: