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
Dmitry Bogatov
a41c0614cc
Make dc_msg_is_starred() return bool
2019-07-30 22:57:28 +00:00
Friedel Ziegelmayer
7ba1a6f79f
Merge pull request #255 from link2xt/dc_open-safer
...
Make dc_open arguments rusty
2019-07-30 00:21:03 +02:00
Alexander Krotov
2d5b04148f
Make dc_open arguments rusty
2019-07-29 04:05:21 +03:00
Friedel Ziegelmayer
188da2a020
refactor(params): rustify
2019-07-29 01:49:53 +02:00
Friedel Ziegelmayer
b23ca26908
refactor(chatlist): rustify
2019-07-28 11:32:48 +02:00
Floris Bruynooghe
ea8d6e8ff0
Write a deltachat.pc file at build time
...
This is writes pkg-config/deltachat.pc file in the target directory,
using the PREFIX environment variable at build time. If this is
undefined at build time /usr/local is used.
2019-07-22 01:16:34 +02:00
holger krekel
8089559958
Squashed commit of the following:
...
commit 6bc5d1b90e
Author: holger krekel <holger@merlinux.eu >
Date: Sun Jul 21 22:56:37 2019 +0200
fix fmt
commit 197d94ad9d
Merge: 7ce337c 686678c
Author: holger krekel <holger@merlinux.eu >
Date: Sun Jul 21 22:51:16 2019 +0200
Merge remote-tracking branch 'origin/master' into eventlogging
commit 7ce337c6d0
Author: holger krekel <holger@merlinux.eu >
Date: Sun Jul 21 22:44:27 2019 +0200
left-over error logging
commit 10148d2e43
Author: holger krekel <holger@merlinux.eu >
Date: Sun Jul 21 22:03:17 2019 +0200
ignore non-utf8 parts of header fields (add comment why it shouldn't happen)
don't throw error if no sql rows are returned
commit 69dc237ee3
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Sun Jul 21 12:56:04 2019 +0200
fix(receive_imf): remove recursive sql call
commit df5464ea80
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Sat Jul 20 17:05:24 2019 +0200
fix: blocked is an optional value
commit e4bf9956a5
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Sat Jul 20 16:50:56 2019 +0200
fix(msg): handle optional in_reply_to
commit d353d9d9d8
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Sat Jul 20 16:17:25 2019 +0200
fix(chat): remove recursive sql usage
commit 1ad45ed4d6
Author: holger krekel <holger@merlinux.eu >
Date: Sat Jul 20 15:14:11 2019 +0200
fix rust fmt
commit 496e980a17
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Sat Jul 20 14:34:20 2019 +0200
use forked rusqlite
commit fa09e46ed9
Author: holger krekel <holger@merlinux.eu >
Date: Sat Jul 20 12:37:51 2019 +0200
another pace where we might (and in my case did) get invalid utf8
commit d6de420b9a
Author: holger krekel <holger@merlinux.eu >
Date: Sat Jul 20 12:30:48 2019 +0200
fix some string issues, introduce to_string_lossy such that to_string() continues to panic on non-utf8
commit 38eb708db8
Author: holger krekel <holger@merlinux.eu >
Date: Sat Jul 20 01:17:53 2019 +0200
for now make to_string() less strict as we often don't want to crash the whole app just because some non-proper utf8 came in (through a message we can't neccesarily congtrol)
commit 7a59da5f8f
Author: holger krekel <holger@merlinux.eu >
Date: Fri Jul 19 22:48:39 2019 +0200
fix linting
commit f13a1d4a2f
Author: holger krekel <holger@merlinux.eu >
Date: Fri Jul 19 22:46:58 2019 +0200
fix some test flakyness
commit 7b3a450918
Author: holger krekel <holger@merlinux.eu >
Date: Fri Jul 19 22:35:07 2019 +0200
- fix saved_mime test which broke to improper conversion of
imf_raw_not_terminated
- some cargo.toml updates no clue where they come from
- log Message-ID for received messages
commit 169923b102
Author: holger krekel <holger@merlinux.eu >
Date: Fri Jul 19 12:31:22 2019 +0200
formatting
commit 42688a0622
Author: holger krekel <holger@merlinux.eu >
Date: Fri Jul 19 12:24:56 2019 +0200
remove some print statements
commit 35f3c0edd1
Merge: e7a2362 f58b1d6
Author: holger krekel <holger@merlinux.eu >
Date: Fri Jul 19 10:25:21 2019 +0200
Merge branch 'master' into eventlogging
commit e7a236264a
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Thu Jul 18 23:20:20 2019 +0200
print invalid strings
commit aaa5b820d9
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Thu Jul 18 23:12:35 2019 +0200
cleanup
commit e7f0745010
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Thu Jul 18 23:03:57 2019 +0200
reduce direc usage of CString
commit c68e7ae14e
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Thu Jul 18 22:47:47 2019 +0200
audit use of to_cstring and fix ub
commit 618087e5a7
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Thu Jul 18 21:38:52 2019 +0200
fix(imap): body ptr lifetime
commit 245abb8384
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Thu Jul 18 19:44:10 2019 +0200
remove debug
commit a3e1042001
Author: dignifiedquire <dignifiedquire@users.noreply.github.com >
Date: Thu Jul 18 18:30:54 2019 +0200
fix some things, add more debugging statements
commit 7b7ce9348f
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 15:11:57 2019 +0200
fix python lint issues
commit 7a4808ba0d
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 14:35:54 2019 +0200
cargofmt
commit 8f240f7153
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 14:03:57 2019 +0200
(dig,hpk) pull out job collection from sql query/lock logic
commit 7d0b5d8abb
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 12:52:02 2019 +0200
remove print statements and fix a crash
commit ee317cb1b5
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 11:38:10 2019 +0200
fix some merge issues
commit 7b736fe635
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 11:16:38 2019 +0200
(dig,hpk) add test and fix for wrong dbs
commit c7db15352a
Merge: 0b37167 0c5015d
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 09:59:44 2019 +0200
Merge branch 'master' into eventlogging
commit 0b37167be8
Author: holger krekel <holger@merlinux.eu >
Date: Thu Jul 18 00:06:05 2019 +0200
address @dignifiedquire comments
commit 5cac4b5076
Author: holger krekel <holger@merlinux.eu >
Date: Wed Jul 17 12:47:22 2019 +0200
remove spurious print
commit 475a41beb3
Author: holger krekel <holger@merlinux.eu >
Date: Wed Jul 17 12:31:12 2019 +0200
address @dignifiedquire rustyness comment and fix changelog
commit ad4be80b4e
Author: holger krekel <holger@merlinux.eu >
Date: Wed Jul 17 10:25:25 2019 +0200
make smtp/imap connect() return bool instead of c-int
commit 8737c1d142
Author: holger krekel <holger@merlinux.eu >
Date: Wed Jul 17 09:26:33 2019 +0200
cleanup some parts, add comments
commit 964fe466cc
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 20:05:41 2019 +0200
wip-commit which passes all tests with proper finalization
commit 43936e7db7
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 16:17:42 2019 +0200
snapshot of my current debugging state
commit 0e80ce9c39
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 12:57:19 2019 +0200
more aggressively skip perform API when threads are closing
commit c652bae68a
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 12:06:05 2019 +0200
intermediate wip commit
commit bc904a495d
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 11:18:56 2019 +0200
add some logging, and a more precise teardown for online python tests
commit 8d99444c6a
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 00:22:12 2019 +0200
fix std
commit 9dab53e0af
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 00:20:54 2019 +0200
rustfmt
commit 360089ac74
Author: holger krekel <holger@merlinux.eu >
Date: Tue Jul 16 00:03:49 2019 +0200
remove some debugging
commit e892c5cf4d
Author: holger krekel <holger@merlinux.eu >
Date: Mon Jul 15 23:31:30 2019 +0200
fix test for events
commit 9ad4c9a6fe
Author: holger krekel <holger@merlinux.eu >
Date: Mon Jul 15 22:51:57 2019 +0200
wip try test that we see INFO events from the core
2019-07-21 23:31:14 +02:00
Alexander Krotov
686678c96c
Spellcheck
2019-07-21 21:40:19 +02:00
dignifiedquire
0c5015d92b
chore: release v1.0.0-alpha.3
2019-07-18 00:34:46 +02:00