Dmitry Bogatov
57daa0f7f0
Remove useless argument of logging macros
...
Previously, logging macros (info! warn! error!) accepted integer
argument (data1), that was passed to callback function verbatim. In all
call sites this argument was 0.
With this change, that data1 argument is no longer part of macro
interface, 0 is always passed to callback in internals of these macros.
2019-09-10 22:26:47 +00:00
Dmitry Bogatov
1cdb9c733a
Change return type of `dc_is_configured' to bool
2019-09-10 19:08:55 +00:00
Alexander Krotov
6a2368f83c
Return bool from dc_continue_key_transfer
2019-09-10 15:15:48 +02:00
holger krekel
2b257e3d0d
fix ffi
2019-09-09 19:45:43 +02:00
holger krekel
5b0c8dd9dd
address @r10s and @flub review comments, and fix some docstrings/test meta docs
2019-09-09 18:07:32 +02:00
Simon Laux
0a8b187f80
fix remove chat profile img
2019-09-09 18:07:32 +02:00
holger krekel
0a6e540394
rename dc_securejoin to securejoin.rs
2019-09-05 22:55:25 +02:00
holger krekel
79510a83de
- remove many *libc::char usages, and c-pointer from fingerprint
...
- rustify get_chat_id_by_grpid and streamline returned chat id handling (thereby apprently fixing the test, don't ask)
2019-09-05 22:55:25 +02:00
jikstra
b9cfcce284
fix ffi
2019-09-05 22:55:25 +02:00
jikstra
70d997964b
cargo fmt
2019-09-05 22:55:25 +02:00
jikstra
cc2339fbe2
Fix closure in dc_securejoin, make sure we return an empty string and
...
never null, make dc_get_securejoin_qr return an Option<String> and move
the logic to cast it to c_str into the ffi
2019-09-05 22:55:25 +02:00
Dmitry Bogatov
fb5d53226d
Fix errorneous ffi check in dc_send_msg
2019-09-01 22:45:49 +00:00
B. Petersen
8902d0843b
fix some return values
2019-08-28 18:32:34 +02:00
B. Petersen
010ac6a6ac
print message to stderr on careless ffi usage
2019-08-28 18:24:01 +02:00
B. Petersen
c71589a710
handle ffi-failures compatible to core-c
2019-08-28 13:46:47 +02:00
Friedel Ziegelmayer
2f6438f75a
refactor: save locations ( #407 )
...
refactor: save locations
2019-08-27 14:27:04 +02:00
dignifiedquire
25b0a26ff9
fix(ffi): handle result from location deletion
2019-08-26 21:50:33 +02:00
B. Petersen
cefbd64f37
allow passing empty arrays to ffi
2019-08-26 21:38:23 +02:00
dignifiedquire
d25d839d6a
refactor(location): more rusty api
2019-08-26 21:29:40 +02:00
dignifiedquire
23d49560bf
refactor(location): rename module dc_location -> location
2019-08-26 21:09:40 +02:00
Alexander Krotov
8a73f84003
Move all unsafe code from dc_array.rs to FFI
2019-08-21 09:30:59 +02:00
Simon Laux
1d32e010ae
Merge pull request #397 from deltachat/move_autoconfig_to_dedicated_file
...
Move moz- and outlk-autoconfig to dedicated files
2019-08-19 19:42:25 +02:00
Simon Laux
491826556b
renaming dc_configure to configure
...
and renaming the autoconfigure modules
2019-08-19 19:03:46 +02:00
dignifiedquire
39abb0b0ad
refactor(message): rename dc_msg to message
2019-08-19 12:13:11 +02:00
dignifiedquire
cb6c8ac78b
refactor(msg): use rust based allocations
2019-08-19 12:10:26 +02:00
Friedel Ziegelmayer
a906faeb35
refactor: a rusty job
...
* refactor(jobthread): safe and rusty
* refactor(job): rusty and safe
2019-08-19 12:07:13 +02:00
Alexander Krotov
1a8e08e429
Merge pull request #396 from deltachat/chat-array
...
Remove dc_array_t from chat.rs
2019-08-19 06:55:58 +00:00
dignifiedquire
d47a693611
refactor: rename dc_qr -> qr
2019-08-19 08:06:54 +02:00
dignifiedquire
886262539a
refactor: save lot implementation and follow up refactors
...
rewrote qr code to match the now safe lot
2019-08-19 08:06:54 +02:00
dignifiedquire
401c5a7cb0
refactor(lot): rename dc_lot to lot
2019-08-19 08:06:54 +02:00
dignifiedquire
b5c66dd52a
refactor(lot): rust memory management
2019-08-19 08:06:54 +02:00
Alexander Krotov
e7cf5a546a
Remove dc_array_t from chat.rs
2019-08-18 23:02:16 +03:00
Alexander Krotov
6b2fe03d08
Replace dc_array_t with Vec in context.rs
2019-08-18 12:44:49 +02:00
dignifiedquire
13d8306a7b
refactor(chat): some minor cleanup and api improvements
2019-08-17 11:40:43 +02:00
dignifiedquire
9b1a74cc22
refactor(chat): remove C strings from the public interface
2019-08-17 11:40:43 +02:00
dignifiedquire
25e97df641
refactor(chat): store rust strings in the chat struct
2019-08-17 11:35:02 +02:00
dignifiedquire
6b3245ddfc
refactor(ffi): use nicer exentsion traits for results
2019-08-17 11:34:10 +02:00
dignifiedquire
001880e1f0
refactor(chat): first round of method renaming and restructuring
2019-08-17 11:34:10 +02:00
dignifiedquire
ddfd067e97
refactor(chat): rust based memory management
2019-08-17 11:30:26 +02:00
dignifiedquire
64117c2964
refactor(chat): rename dc_chat to chat
2019-08-17 11:30:26 +02:00
dignifiedquire
c8ce099f22
refactor(chat): improve field types by using enums and bools
2019-08-17 11:29:08 +02:00
Jikstra
d946774741
Make dc_msg_get_summarytext_by_raw safe ( #316 )
...
* Make dc_msg_get_summarytext_by_raw safe
* use dc_truncate method in all places
* Fix tests and add docs to dc_truncate()
* Make text argument an AsRef<&str> and rename type_0 to viewtype
* Fix too early return in dc_msg_get_summarytext_by_raw. Fixes https://github.com/deltachat/deltachat-core-rust/issues/313
2019-08-16 14:58:20 +02:00
Alexander Krotov
fadcd43fee
Move some unsafe dc_array_* functions to FFI
2019-08-16 00:53:32 +03:00
Alexander Krotov
37622af55a
Return Vec<dc_location> from dc_get_locations
2019-08-15 20:43:04 +02:00
Alexander Krotov
29d4f6888d
Store IDs in dc_array as u32
...
This changes dc_array_get_raw API
2019-08-15 01:54:51 +02:00
Alexander Krotov
5b47409fb0
Remove unused dc_array_* API
2019-08-15 01:54:51 +02:00
Alexander Krotov
88a81f5737
Return Vec from get_all_blocked
...
And never return nullptr from dc_get_blocked_contacts.
2019-08-13 23:56:17 +02:00
Alexander Krotov
fb7bbac524
Return Vec from dc_get_chat_contacts
2019-08-13 02:37:18 +03:00
Floris Bruynooghe
5438be891b
Remove dc_context_unref from Rust API
...
This removes the dc_context_unref function from the Rust API which was
just an alias for dc_close. It still exists on the C API where it
makes sure to free the memory.
It also implements Drop for the context which just calls dc_close to
make sure all the memory is freed. Since you can call dc_close as
many times as you like this ensures that at the Rust level you can't
Drop the struct without releasing the memory.
Finally since memory is now freed by dropping the struct this removes
the #[repr(C)] for the struct. This struct is fully opaque to the C
API.
2019-08-10 12:04:11 +02:00
Floris Bruynooghe
f31f603c8b
Turn dc_ensure_secret_key_existy into something more rusty
...
This marks the function safe and returns Result, it also now returns
the ConfiguredAddr since it has to look this up anyway and it makes
testing more easy. Turns out it reduces some duplicate SQL query in
some callers too.
More test code has been moved from dc_imex to test_utils as it's
more genrally applicable.
2019-08-10 11:14:40 +02:00