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
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
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
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
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
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
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
Dmitry Bogatov
95d8665dbe
Refine signature of dc_get_oauth2_access_token()
...
Previously, `dc_get_oauth2_access_token` accepted "flags" argument,
that actually had only one possible field: 0x1 == DC_REGENERATE.
This change replaces "flags" argument with single boolean argument
"regenerate".
2019-09-18 19:29:39 +02:00
dignifiedquire
8667de994e
use proper Result instead of Option for encryption and decryption
2019-09-18 19:21:41 +02:00
holger krekel
cee0e22ce7
fix #538 -- don't crash on wrong setup codes for ac-message, don't use "expect(), added test
2019-09-18 19:21:41 +02:00
holger krekel
dc8a2f54e5
use utf8 lossy strings for saved mime headers (as discussed on PR and IRC with @r10s)
2019-09-18 16:47:04 +02:00
dignifiedquire
b3bc5b2520
fix(receive_imf): do not attempt to convert raw body to utf8
2019-09-18 16:47:04 +02:00
Dmitry Bogatov
8a3bf6a5d9
Remove use of `dbg!' macro
...
According to documentation[^1], this macro should not be in version
control, and should only be used for debugging.
https://doc.rust-lang.org/std/macro.dbg.html
2019-09-18 14:35:49 +02:00
Dmitry Bogatov
d5f361d386
Use include_str! macro instead of embedding key into source
...
Additionally, this change reduces duplication: now test public key is
stored in only one place, and used in two instead of copy-paste of very
long line.
2019-09-18 14:35:49 +02:00
Dmitry Bogatov
7bb4a27b60
Make Context.cb field private (no code changes)
2019-09-18 14:35:49 +02:00
holger krekel
3bd36feede
fix broken rust mimeparser fuzzy tests
2019-09-18 14:15:16 +02:00
Dmitry Bogatov
d644ca5563
Add property test for simplify_plain_text
2019-09-18 07:34:56 +02:00
Dmitry Bogatov
b3b1e37192
Add tests for dc_dehtml
2019-09-18 07:34:56 +02:00
Dmitry Bogatov
38f39c8d32
Add smoke test for Context.get_fresh_msgs
2019-09-18 07:34:56 +02:00
Dmitry Bogatov
a773b7929c
Add fuzzy-test for dc_mimeparser_parser
2019-09-18 07:33:22 +02:00
Dmitry Bogatov
7b73103133
Add test for mime parsing reportedly crash-inducing message
2019-09-18 07:33:22 +02:00
holger krekel
2b038a34c9
Merge branch 'master' into refactor/remove-mprintf
2019-09-17 15:46:05 +02:00
dignifiedquire
e710836276
cleanup and fix earlier introduced scoping error
2019-09-16 22:58:10 +02:00
dignifiedquire
6be3c9a48a
refactor: improve mime field lookup
2019-09-16 22:58:10 +02:00
dignifiedquire
c0747bf68d
refactor: use enum for system messages
2019-09-16 22:58:10 +02:00
dignifiedquire
0346dd15d9
refactor(mimeparser): some more sanity
2019-09-16 22:58:10 +02:00
dignifiedquire
ff0aa8423d
refactor: remove now unused build.rs and extern declarations
2019-09-16 07:59:41 +02:00
dignifiedquire
0f718e0d08
refactor(mimefactory): remove dc_mprintf
2019-09-16 07:59:41 +02:00
dignifiedquire
9534a9ad30
refactor(mimeparser): remove dc_mprintf
2019-09-16 07:59:41 +02:00