dignifiedquire
05f9f454c3
refactor: remove x module and delete deadcode
2019-09-21 17:56:49 +02:00
Friedel Ziegelmayer
b85f59798c
refactor(chat): remove c types and unsafe ( #572 )
...
refactor(chat): remove c types and unsafe
2019-09-21 17:14:52 +02:00
dignifiedquire
e80345a05b
refactor(chat): remove c types and unsafe
2019-09-21 16:59:59 +02:00
dignifiedquire
0bdcc3d616
refactor(message): remove remaining unsafe and c types
2019-09-21 16:37:19 +02:00
dignifiedquire
987f12740e
refactor(message): remove unsafe and c types from the Message api
2019-09-21 16:37:19 +02:00
dignifiedquire
1265016a55
refactor(message): rustiy api
2019-09-21 16:37:19 +02:00
Friedel Ziegelmayer
48d1de3678
Avoid ok-to-continue pattern in set_draft_raw ( #570 )
...
Avoid ok-to-continue pattern in `set_draft_raw`
2019-09-21 14:32:20 +02:00
Dmitry Bogatov
43f6db3252
cargo-fmt
2019-09-21 06:19:55 +00:00
Dmitry Bogatov
5b917e7d10
Remove last mutable variable from do_set_draft
2019-09-21 06:19:21 +00:00
Dmitry Bogatov
0523868a88
Avoid ok-to-continue pattern in "do_set_draft" function
...
Note: I strongly suggest reviewing this commit in side-by-side mode.
Note: This commit fails CI due incorrect formatting. It is done
deliberately to simplify review process.
2019-09-21 06:16:15 +00:00
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