Commit Graph

1062 Commits

Author SHA1 Message Date
Dmitry Bogatov 26f176eb7e Factor another part of set_draft_raw into separate function 2019-09-21 06:04:55 +00:00
Dmitry Bogatov ad32b5ca8f cargo-fmt 2019-09-21 05:44:31 +00:00
Dmitry Bogatov dbf14179dc Make message argument to set_draft_raw() no longer optional
Previously, "set_draft_raw" function was used with "msg = None" only for
side-effect of removing current draft message in chat.

After draft removal functionality was factored into separate
"maybe_delete_draft" function, it is used directly in only call site,
which used to invoke "set_draft_raw" with optional message.

This function is private, and this refactoring does not change FFI
interface.

Note: This commit fails CI due incorrect formatting. It is done
deliberately to simplify review process.
2019-09-21 05:34:48 +00:00
Dmitry Bogatov 45b0a4ec27 Factor part of set_draft_raw into new function maybe_delete_draft 2019-09-21 05:24:03 +00:00
dignifiedquire 1969ee02a5 refactor(mimeparser): rustify mailmime_get_type 2019-09-21 00:51:36 +02:00
dignifiedquire 266b205c75 refactor: rustify interface of maimlime_transfer_decode 2019-09-21 00:51:36 +02:00
Dmitry Bogatov 7dd3bad8bd Add factory method MimeFactory::new
* src/dc_mimefactory.rs(new): add factory method to have verbose
   initialization of all (more than 10) MimeFactory fields only in one place.
 * src/dc_mimefactory.rc(dc_mimefactory_load_msg, dc_mimefactory_load_mdn):
   simplify code (and reduce linecount) using Mimefactory::new
2019-09-20 22:49:33 +02:00
holger krekel 4b45be7cda cargo fmt only 2019-09-20 22:43:20 +02:00
holger krekel 497ffd86fa make logic and comments more like C (early returns instead of nestedness)
next commit: cargo fmt
2019-09-20 22:43:20 +02:00
dignifiedquire 0bdcc4269f refactor(mimeparser): split and cleanup parse_mime_recursive 2019-09-20 21:42:23 +02:00
Friedel Ziegelmayer e583c99f94 Make return type of Image::mv an enum (#548)
Make return type of Image::mv an enum
2019-09-20 20:56:27 +02:00
Friedel Ziegelmayer e22e50c3fa Rename dc_mimefactory_t -> MimeFactory (#563)
Rename dc_mimefactory_t -> MimeFactory
2019-09-20 20:56:12 +02:00
Dmitry Bogatov e9c9a3e1ce Change type of MimeFactory.loaded to enum
* src/dc_mimefactory.rs(MimeFactory): change type of `loaded` field
 * src/dc_mimefactory.rs(Loaded): new enum, describing possible
   values of `loaded` field of `MimeFactory` structure
 * src/dc_mimefactory.rs(dc_mimefactory_loaded_t): remove unused type alias
 * src/job.rs(add_smtp_job): adjust call site by removing multiple casts
 * src/dc_mimefactory.rs(dc_mimefactory_render): ditto
2019-09-20 18:02:57 +00:00
Dmitry Bogatov fa7bb71f3f Change type of MimeFactory.out_{gossip,encrypted} to bool 2019-09-20 18:02:57 +00:00
Dmitry Bogatov 34a3ad82e0 Rename dc_mimefactory_t -> MimeFactory
CamelCase naming convention is more natural for Rust.

https://rust-lang-nursery.github.io/api-guidelines/naming.html
2019-09-20 18:02:57 +00:00
Dmitry Bogatov 2f5d74dbf4 Remove unused constants from src/imap.rs 2019-09-20 17:35:26 +00:00
Dmitry Bogatov 4bf5ba594c Make Imap::set_mdnseen return enum, not int 2019-09-20 17:35:26 +00:00
Dmitry Bogatov 6e2da27f45 Change return type of Imap::set_seen to enum 2019-09-20 17:35:26 +00:00
Dmitry Bogatov 6ee9465d43 Make return type of Image::mv an enum
Replace named constants with enum to improve type-safety and make
exhausiveness checks possible.

Note, that since this enum never pass FFI border, its numeric values
does not need to be specified explicitly and can be left on compiler's
discretion.
2019-09-20 17:35:25 +00:00
Dmitry Bogatov 391a6bf422 Replace numbers with named constants 2019-09-20 17:35:25 +00:00
Floris Bruynooghe 5001a0e37d Fix dc_make_rel_path
This was not substituting $BLOBDIR correctly.
2019-09-20 18:38:39 +02:00
holger krekel fd8d16a7db replace weird pointer-loops with nice for-loops (thanks @dignifiedquire for guiding) 2019-09-20 17:52:07 +02:00
holger krekel f3ac9306f3 use bool instead of int 2019-09-20 17:52:07 +02:00
holger krekel 59740d0b56 remove unused var, numbers to const-names 2019-09-20 17:52:07 +02:00
holger krekel fb05a6c26f transfer docs to and cleanup some parts of e2ee::decrypt() 2019-09-20 17:52:07 +02:00
holger krekel 7943b708d2 dc_mimeparser: do a round of renames on numbers to constants and add comments from the C code 2019-09-20 15:23:34 +02:00
dignifiedquire 04e37d1eca chore: update mmime to released version and other deps 2019-09-20 12:02:08 +02:00
holger krekel 91b98e8c6d as discussed during camp and otherwise ... add dc_perform_{mvbox,sentbox}_jobs hooks which, however, for now have an empty implementation. They can already be called from UIs, though. Next step is refactoring imap-job handling to only execute jobs belonging to the respective imap folder. 2019-09-20 01:03:25 +02:00
Floris Bruynooghe 70234e5b19 Add a test for fix in #541
A fixed bug should have a test.  This is an easy test to write.
2019-09-20 00:46:54 +02:00
holger krekel ceff85d892 add test and python API for verified group handling/chatting
add msg.is_encrypted() API and check for it from some tests
2019-09-20 00:33:33 +02:00
holger krekel 9f914dd42e fix test-state modification bug (online tests running after OnlineConfigureFails tests would break) 2019-09-19 23:01:51 +02:00
holger krekel 24f5d68fef add configure-failure tests 2019-09-19 23:01:51 +02:00
Dmitry Bogatov 735fc325b1 Add test for export_key_to_asc_file 2019-09-19 21:43:54 +02:00
Dmitry Bogatov 178b216e48 Reduce number of arguments of export_key_to_asc_file
Previously, this function accepted both key id (integer) and is_default
(boolean). If `is_default` flag was set, value `id` parameter wasn't
used. This commit compresses two argument into single `id: Option<i64>`.
2019-09-19 21:43:54 +02:00
Simon Laux 5d0481f7a2 use provider overview crate instead of git 2019-09-19 20:07:34 +02:00
holger krekel 711bc69750 address @dignifiedquire comment 2019-09-19 20:03:16 +02:00
holger krekel 7263c9490d refactor rfc724_mid parsing and creation to avoid char*, add tests 2019-09-19 20:03:16 +02:00
holger krekel 0c88bc6ac7 more rfc724_mid cleanup 2019-09-19 20:03:16 +02:00
holger krekel fda8d0a2e2 factory.rfc724_mid is a String now (instead of C-Char*) 2019-09-19 20:03:16 +02:00
holger krekel 14bdf7fae8 make dc_create_outgoing_rfc724_mid safe and simplify call sites 2019-09-19 20:03:16 +02:00
holger krekel d4ff7ecbaa split qr tests 2019-09-19 20:00:27 +02:00
Dmitry Bogatov 030aec7373 Read example GPG keys from files using include_str!
For consistency with other tests that use example public and private
keys, replace use of `concat!` macro with `include_str!`. This way, key
data embedded into source with single line of code.
2019-09-19 18:57:39 +02:00
B. Petersen 6a351de4f9 cargo fmt 2019-09-19 18:42:29 +02:00
B. Petersen bbff1c9c3e test that bad credentials do not panic 2019-09-19 18:42:29 +02:00
B. Petersen bbb8144129 do not panic when 0 (=failure) is passed to the progress! macro 2019-09-19 17:00:01 +02:00
Friedel Ziegelmayer 83f3e23297 improve python caching (#468)
(@dignifiedquire and @hpk42) 
- introduce rust-caching to python test runs 
- skip release and ffi runs, they are check using python bindings
- shuffle files such that ci_scripts/ contains all the ci scripts
- partly parallelize python tox runs
2019-09-19 13:10:19 +02:00
B. Petersen 4f880932ae change oder of typedefs, function-definitions and defines
as c is top-down, we start with the typedefs
so that functions can use them freely.
after that, the functions are declared
and finally the #defines (for less noise in the function sections).
grouping is done by classes.
2019-09-19 12:58:26 +02:00
B. Petersen 62e8c2497c add missing doxygen commands, fix typo 2019-09-19 12:58:26 +02:00
Simon Laux 37f854be3e Add provider info functions to the FFI API
A lot of work from @Hocuri and @Simon-Laux mostly.

This exposes the API of the deltachat-provider-overview crate on the
deltachat FFI API, allowing clients to use it to help users set up
their accounts.
2019-09-19 07:17:44 +02:00
Dmitry Bogatov e0e82e1877 Fix ffi interoperability issue
Clients expect empty "dbfile" argument to be treated as NULL value.
This change fulfills their expectations.

Closes: #530
2019-09-19 07:15:35 +02:00