dignifiedquire
ecaae42b80
refactor(examples): remove dc_mprintf
2019-09-16 07:58:08 +02:00
dignifiedquire
0bf3d20e07
fix and implement ffi tranlation
2019-09-15 23:40:08 +02:00
dignifiedquire
5486ac5b9f
refacor: use an enum for events
2019-09-15 23:40:08 +02:00
dignifiedquire
16c281a9b7
refactor(context): safe interface
2019-09-15 16:36:31 +02:00
dignifiedquire
f31f341a50
feat: enforce Debug implementations and remove mod types
2019-09-15 16:36:31 +02:00
dignifiedquire
de1e3e1d4f
refactor(context): remove last unsafe bits from the context struct
2019-09-15 16:36:31 +02:00
Floris Bruynooghe
afc9a31080
Remove dc_open call
...
A new context is now created by calling Context::new and therefore you
always have a valid context. This is much more in Rust style and will
allow a lot of furture simplifications on the context itself.
The FFI layer has not yet been adjusted in this commit and thus will
fail.
2019-09-15 02:37:13 +02:00
Simon Laux
e5699e8ba9
Merge pull request #517 from deltachat/fix_get_draft
...
Fix get_draft to just return null and not produce errors if there's no
2019-09-14 23:39:09 +02:00
Floris Bruynooghe
8a7143b791
Return a Result<Option<Message>> for get_draft
...
The function can fail, so we need to still have an error return as
well as a no-draft return.
Add tests.
2019-09-14 23:00:13 +02:00
Alexander Krotov
fad49e08d7
message.rs: resolve "should return bool" TODOs
2019-09-14 12:03:10 +03:00
Alexander Krotov
0f67b16f29
Return bool from add_contact_to_chat_ex
2019-09-14 12:03:10 +03:00
Alexander Krotov
400ab2cdab
Return bool from dc_msg_get_showpadlock
2019-09-14 12:03:10 +03:00
Floris Bruynooghe
aefddf7f5e
Remove context refrence from Contact struct
...
This will allow the Rust Context API to be refactored without breaking
the C API. Full details in #476 aka
a0b5e32f98
2019-09-11 23:53:48 +02:00
Floris Bruynooghe
5ce27b16f1
Remove context refernce from Chatlist
...
See #476 aka a0b5e32f98 for full
rationale. Tl;dr it allows us to evolve the Rust API while keeping
the FFI API identical.
2019-09-11 23:53:48 +02:00
Floris Bruynooghe
8302d6833d
Remove context ref from Chat struct
...
Leaving the C API untouched. See #476 aka
a0b5e32f98 for more extensive rationale.
2019-09-11 23:53:48 +02:00
Floris Bruynooghe
a0b5e32f98
Remove the context reference from Message struct
...
The Message struct had a reference to the context which made a few
APIs a little easier. However it has surprising consequences a long
way down the line as shown in #335 : it means any object which has such
a reference needs to keep open a lock if we want to do this refactor
of no longer having a "closed" Context struct on the Rust API (which
has many benefits which will simply that Context struct and is more
the Rust way - RAII etc).
By refactoring away the context reference on the rust API as done in
here however, we push this behaviour of how these references are
handled back to the C-API pointer behaviour: that is unsafe but just
works in a C-like way. The resulting complexity in the FFI layer is
also notably less than in the #335 alternative.
As a consequence all APIs which require the context, now explicitly
need to get the context passed in as an argument. It looks like this
is certainly no downside and maybe even beneficial for further API
refactors.
For this strategy to work out the same should be done to
dc_chatlist_t, dc_chat_t and dc_contact_t. But this working for
dc_msg_t give a reasonable confidence that this is a good approach.
2019-09-11 21:48:40 +02:00
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
Alexander Krotov
6a2368f83c
Return bool from dc_continue_key_transfer
2019-09-10 15:15:48 +02:00
B. Petersen
c603ca0e7a
remove dead code
2019-09-08 07:26:07 +02:00
B. Petersen
9605370f0b
fix cmdline: sendimage and sendfile really accept only a file
2019-09-07 12:34:31 +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
70d997964b
cargo fmt
2019-09-05 22:55:25 +02:00
jikstra
4ffe71e1df
Fix encoding for email & name, fix qrencode command in repl
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
2fe07e86c7
Replace explicit casts from 0 to pointer with std::ptr::null
2019-08-27 21:22:03 +00: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
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
91481caf89
cargo fmt
2019-08-19 19:04:12 +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
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
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
Alexander Krotov
37622af55a
Return Vec<dc_location> from dc_get_locations
2019-08-15 20:43:04 +02:00
dignifiedquire
712f5a9782
refactor(tools): cleanup and make clippy a little happier
...
Uses a crate now for extracing image meta data, instead of our own hand rolled code.
2019-08-15 11:26:32 +02:00
dignifiedquire
523141597e
chore: remove no longer needed features
2019-08-13 12:20:53 +02:00