Commit Graph
141 Commits
Author SHA1 Message Date
B. Petersen 11dd156594 tweak title 2019-08-26 19:17:58 +02:00
B. Petersen 78587ee6b1 add howto-generate-ffi-documentation 2019-08-26 19:17:58 +02:00
B. Petersen 7632eb1ce0 make doxygen work 2019-08-26 19:17:58 +02:00
B. Petersen 3eea175d36 ffi docs for dc_lot_t 2019-08-26 19:17:58 +02:00
B. Petersen 8f24ff74dd ffi docs for dc_contact_t 2019-08-26 19:17:58 +02:00
B. Petersen 6fab7d0a27 ffi docs for dc_msg_t 2019-08-26 19:17:58 +02:00
B. Petersen 7cc52e0a55 ffi docs for dc_chat_t 2019-08-26 19:17:58 +02:00
B. Petersen aa0801014a ffi docs for dc_chatlist_t 2019-08-26 19:17:58 +02:00
B. Petersen 9e379338bc ffi docs for dc_array_t 2019-08-26 19:17:58 +02:00
B. Petersen ba62d13a14 ffi docs for dc_context_t 2019-08-26 19:17:58 +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
Jikstra 2bb2ef07e9 Merge pull request #381 from deltachat/dc_array_ffi
Move some unsafe dc_array_* functions to FFI
2019-08-16 01:48:16 +02:00
Alexander Krotov fadcd43fee Move some unsafe dc_array_* functions to FFI 2019-08-16 00:53:32 +03:00
B. Petersen 5af800b16a declare void function as such 2019-08-15 23:52:04 +02: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
dignifiedquire 6f290e249f chore: release v1.0.0-alpha.4 2019-08-14 13:58: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
Friedel Ziegelmayer ea6972118a refactor: rusty contact
* refactor(contact): rename and rusty memory allocations
* refactor(contact): use enum to indidcate origin
* refactor(contact): safe blocking and unblocking api
* refactor(contact): only safe and no more cstrings
2019-08-07 22:20:48 +02:00
Dmitry Bogatov 760332262d Add more assertions to `deltachat-ffi' library
Change code to panic! on invalid input (null pointers, out-of-range
identifiers) instead of silently doing nothing.
2019-08-07 20:36:00 +02:00
Dmitry Bogatov 765ac2005e Change type of dc_msg_t.text to String
Also, remove `send-garbage' command from REPL, since it is not possible to send
non-utf8 string anymore.
2019-08-07 20:31:02 +02:00
Floris Bruynooghe b6b0849bce Remove to_cstring() naming convention ambiguity
Add a trait for str.strdup() to replace to_cstring() which avoid the
signature ambiguity with .to_string().

Also instruduce CString::yolo() as a shortcut to
CString::new().unwrap() and use it whenever the variable does can be
deallocated by going out of scope.  This is less error prone.

Use some Path.to_c_string() functions where possible.
2019-08-01 19:06:39 +02:00
Dmitry Bogatov c04c8ff103 Introduce new enum: Viewtype
With this change, kind of message is represented by value of enum
`Viewtype' instead of raw libc::c_int, providing more type safety. This
enum replaces DC_MSG_* constants. The only way to create `Viewtype' from
libc::c_int is smart constructor.

With this change, functions `dc_get_chat_media' and `dc_get_next_media' became
less forgiving about invalid message type arguments. Previously, invalid
message types were implicitly interpreted as 0 (Viewtype::Unknown). Now,
function calls with invalid message type arguments are rejected (error code
returned) on FFI boundary.

Additionally, when `Viewtype' is read from database, it is checked to have
sensible value.

No tests assumed forgiving behaviour.
2019-08-01 06:05:56 +00:00
Friedel Ziegelmayer 3370b9cfcb Merge pull request #268 from KAction/string-os-name
Change Context.os_name field to String
2019-07-31 22:13:18 +02:00
Dmitry Bogatov 39e530f759 Change Context.os_name field to String 2019-07-31 15:45:35 +00:00