Dmitry Bogatov
d4650ba4a9
Add Rust clone of python `prepare_and_send' test
...
Previous version of patch, that changed type of `dc_msg_t.text' to String had
been breaking `prepare_and_send' test in Python.
This commit adds same regression test, reimplemented in Rust, since running
Rust tests is simplier and faster.
2019-08-07 20:31:02 +02:00
Dmitry Bogatov
4d9bd46c9d
Add note about possible cause of lost messages
2019-08-06 22:09:43 +02:00
jikstra
76d3d86a9e
import dc_extract... method for rustdoc example
2019-08-06 21:33:01 +02:00
jikstra
c0b1e41820
Improve function documentation
2019-08-06 21:33:01 +02:00
jikstra
10689f45f4
cargo fmt
2019-08-06 21:33:01 +02:00
jikstra
205e2d4e99
Fix rustdoc
2019-08-06 21:33:01 +02:00
jikstra
5b368960c0
Apply requested changes
2019-08-06 21:33:01 +02:00
jikstra
9ecd0f80dc
Fix test and simplify if gate
2019-08-06 21:33:01 +02:00
jikstra
45eec35e6e
Make dc_extract_grpid_from_rfc724_mid take/return &str instead of String
2019-08-06 21:33:01 +02:00
jikstra
b74a86f617
Run cargo fmt
2019-08-06 21:33:01 +02:00
jikstra
ff95c44d51
Make receive_imf use safe version of dc_extract_grpid_from_rfc724_mid
...
- Remove unused unsafe wrapper
- Adjust tests to use safe version
2019-08-06 21:33:01 +02:00
jikstra
d5168916df
Refactor dc_extract_grpid_from_rfc724_mid_list and rename test
2019-08-06 21:33:01 +02:00
jikstra
282f964f2f
Add tests for dc_extract_grpid_from_rfc724_mid and implement safe
...
version of dc_extract_grpid_from_rfc724_mid
2019-08-06 21:33:01 +02:00
Simon Laux
7b5073b634
?1 and ?2
2019-08-06 09:02:41 +02:00
Simon Laux
59bb9add2a
fix an type error
2019-08-06 09:02:41 +02:00
Simon Laux
ed95752f8f
use DC_CONTACT_ID_SELF constant instead of 1
2019-08-06 09:02:41 +02:00
Simon Laux
81719c4b33
add coment that helps with understanding the code
2019-08-06 09:02:41 +02:00
Simon Laux
fc6019e3c9
fix sql statement in order to close #163
2019-08-06 09:02:41 +02:00
Alexander Krotov
5811248bfc
Merge pull request #289 from KAction/new-assert
...
python: assert that underlying dc_msg_t* for Message is not NULL
2019-08-04 12:58:04 +00:00
Dmitry Bogatov
47b76ceb3e
python: assert that underlying dc_msg_t* for Message is not NULL
2019-08-04 09:17:54 +00:00
Floris Bruynooghe
0051720d1b
Kill to_cstring with fire
...
I swear I already did this, see #273 .
2019-08-04 09:49:41 +02:00
Jikstra
d814dffbb0
Merge pull request #281 from deltachat/new-mmime
...
chore: update mmime to 0.1.1
2019-08-03 15:31:36 +02:00
dignifiedquire
4e1e32df65
chore: update mmime to 0.1.1
2019-08-03 11:12:21 +02:00
Floris Bruynooghe
d2b23b727b
Restore carriage-return handling to how it was in dcc
...
Some part of the translation seems to have got this wrong somewhere.
Add a test and restore handling to something more sane again.
2019-08-03 01:00:59 +02:00
Floris Bruynooghe
d37dda6f50
Turn the function safe
2019-08-03 01:00:59 +02:00
Floris Bruynooghe
c568d5dcac
Safe string usage
...
Mostly safe string usage, but some other minor cleanups:
- This isn't used from any C code, so no extern C.
- Use Config enums rather than strings.
- Clean up old unused sql statements.
2019-08-03 01:00:59 +02:00
Floris Bruynooghe
227ef1b467
Add unittest
...
This should give us some confidence in the refactoring.
2019-08-03 01:00:59 +02:00
dignifiedquire
a8cea64f39
feat(deps): update rusqlite to official version again
...
A fix for the non utf8 strings has been merged and released in `0.20`
2019-08-03 00:11:23 +02:00
Friedel Ziegelmayer
294e855bbe
Merge pull request #276 from link2xt/lines
...
Return Vec instead of carray from dc_split_into_lines
2019-08-02 20:28:23 +02:00
Alexander Krotov
c5eef21645
Remove carray use and comment
2019-08-02 13:12:32 +03:00
Alexander Krotov
d64fcece5b
Return Vec instead of carray from dc_split_into_lines
2019-08-02 13:12:25 +03:00
Friedel Ziegelmayer
0a9f3ae160
Use Vec instead of carray in dc_forward_msgs() ( #277 )
...
Use Vec instead of carray in dc_forward_msgs()
2019-08-02 11:05:28 +02:00
Friedel Ziegelmayer
acbedbd352
Remove unused function dc_simplify_simplify ( #278 )
...
Remove unused function dc_simplify_simplify
2019-08-02 11:05:05 +02:00
Alexander Krotov
e78b879c9e
Remove unused function dc_simplify_simplify
2019-08-02 09:29:54 +03:00
Alexander Krotov
1145c3533b
Use Vec instead of carray in dc_forward_msgs()
2019-08-02 01:34:15 +03:00
Friedel Ziegelmayer
0d41a78182
Merge pull request #272 from link2xt/parts_vec
...
Store dc_mimeparser_t::parts as Vec instead of carray
2019-08-01 23:50:53 +02:00
Alexander Krotov
a4f94dbf86
Store dc_mimeparser_t::parts as Vec instead of carray
2019-08-01 23:21:56 +03: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
Friedel Ziegelmayer
e7428887d0
Introduce new type: Viewtype ( #256 )
...
Introduce new type: Viewtype
2019-08-01 12:17:33 +02:00
Friedel Ziegelmayer
a7269e7096
Merge pull request #274 from KAction/refine-bool
...
Narrow types of struct fields, that use only two values.
2019-08-01 11:22:55 +02:00
Dmitry Bogatov
7394666266
Refine type of SmtpState.doing_jobs to bool
2019-08-01 06:51:52 +00:00
Dmitry Bogatov
8eb5cec9ce
Refine type of SmtpState.suspended to bool
2019-08-01 06:41:50 +00:00
Dmitry Bogatov
b2807429cc
Refine type of SmtpState.probe_network to bool
2019-08-01 06:37:06 +00:00
Dmitry Bogatov
07d7316a9f
Refine type of Context.perform_inbox_jobs_needed to bool
2019-08-01 06:31:58 +00:00
Dmitry Bogatov
1f9807ccfe
Refine type of Context.probe_network to bool
2019-08-01 06:24:50 +00:00
Dmitry Bogatov
3358d09148
Derive and use Display trait for Viewtype
2019-08-01 06:05:56 +00: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
e7456248a0
Merge pull request #244 from link2xt/dc_location_vec
...
Replace some dc_array_t with Vec<dc_location>
2019-07-31 22:15:35 +02: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
Friedel Ziegelmayer
022c7c2f07
Merge pull request #266 from KAction/dc_msg_is_starred_bool
...
Make dc_msg_is_starred() return bool
2019-07-31 22:06:48 +02:00