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
Alexander Krotov
9e50e77031
Simplify dc_initiate_key_transfer()
2019-07-31 22:06:05 +02:00
Friedel Ziegelmayer
39e9cfd908
Merge pull request #269 from link2xt/dc_array_sort_ids
...
Make dc_array_sort_ids() safe and move it into impl
2019-07-31 22:04:17 +02:00
Friedel Ziegelmayer
c29c893426
Merge pull request #270 from link2xt/get_backoff_time_offset-safe
...
Mark get_backoff_time_offset as safe
2019-07-31 22:03:29 +02:00
Friedel Ziegelmayer
16028cc5dc
Merge pull request #271 from link2xt/reports_vec
...
Replace dc_mimeparser_t::reports carray with Vec
2019-07-31 22:02:35 +02:00
Dmitry Bogatov
39e530f759
Change Context.os_name field to String
2019-07-31 15:45:35 +00:00
jikstra
8274c6bf17
Allow non_snake_case in dc_replace_bad_utf8_chars function
2019-07-31 16:26:17 +02:00
jikstra
566d255b33
run cargo fmt
2019-07-31 16:26:17 +02:00
jikstra
9fb9fb0fc1
Remove goto/current_block logic with OK_TO_CONTINUE. Keeps identation
2019-07-31 16:26:17 +02:00
Alexander Krotov
164a8fe39a
encode_66bits_as_base64: use base64 crate
2019-07-31 16:25:01 +02:00
Alexander Krotov
0b679f8b95
dc_tools: Make dc_create_id() safe
2019-07-31 16:25:01 +02:00
Alexander Krotov
8267ffb8d2
Replace dc_mimeparser_t::reports carray with Vec
2019-07-31 15:57:05 +03:00
Alexander Krotov
7bc338fc72
Mark get_backoff_time_offset as safe
2019-07-31 15:51:50 +03:00
Alexander Krotov
d6dae0a9e8
Make dc_array_sort_ids() safe and move it into impl
2019-07-31 03:21:13 +03:00
Dmitry Bogatov
a41c0614cc
Make dc_msg_is_starred() return bool
2019-07-30 22:57:28 +00:00
Dmitry Bogatov
73298c0273
chore: fix and enforce compiler warnings on CI
2019-07-30 09:58:28 +02:00
Friedel Ziegelmayer
b44c7928f2
Merge pull request #265 from link2xt/safe_cb_set_config
...
Make cb_set_config() safe
2019-07-30 09:53:56 +02:00
Friedel Ziegelmayer
dd9b83dc24
Merge pull request #264 from link2xt/key-to_asc-safe
...
Make key::to_asc return String
2019-07-30 09:53:42 +02:00
Friedel Ziegelmayer
e79c168279
Merge pull request #263 from link2xt/sql-is_file_in_use-safe
...
sql.rs: make is_file_in_use() safe
2019-07-30 09:53:13 +02:00
Alexander Krotov
707c8c2830
Make dc_split_armored_data return bool ( #251 )
...
* Make dc_split_armored_data return bool
* Remove double negations
2019-07-30 08:46:36 +02:00
Alexander Krotov
f87c98d6ea
Make cb_set_config() safe
2019-07-30 02:43:50 +03:00
Alexander Krotov
76e76470e0
Replace range loop with foreach loop
2019-07-30 02:34:05 +03:00
Alexander Krotov
ae6c41a019
dc_kml_t: replace Option<dc_array_t> with Option<Vec<dc_location>>
2019-07-30 02:34:05 +03:00
Alexander Krotov
81a84620eb
Store dc_kml_t::locations as Option<dc_array_t> instead of pointer
2019-07-30 02:34:05 +03:00
Alexander Krotov
14e42b48bd
dc_get_locations: use from(Vec<dc_location>) instead of add_location
2019-07-30 02:34:05 +03:00
Alexander Krotov
2688a397aa
Implement From<Vec<dc_location>> for dc_array_t
2019-07-30 02:32:24 +03:00
Alexander Krotov
3ace4fcc2f
Make key::to_asc return String
2019-07-30 02:22:08 +03:00
Friedel Ziegelmayer
9314a5a8fd
Merge pull request #252 from link2xt/dc_get_config-safe
...
Make dc_get_config_t safe
2019-07-30 00:25:29 +02:00
Friedel Ziegelmayer
5bf2d7c5ac
Merge pull request #253 from link2xt/is_file_size_okay-bool
...
Return bool from is_file_size_okay
2019-07-30 00:24:13 +02:00
Friedel Ziegelmayer
1fbd16310a
Merge pull request #262 from link2xt/thread-constants
...
dc_job.rs: add DC_{IMAP,SMTP}_THREAD constants
2019-07-30 00:23:34 +02: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
Friedel Ziegelmayer
2c66837df4
Merge pull request #261 from link2xt/dc_timestamp_to_str
...
Remove unsafe version of dc_timestamp_to_str
2019-07-30 00:19:33 +02:00
Alexander Krotov
21b4147d15
sql.rs: make is_file_in_use() safe
2019-07-30 01:15:51 +03:00
KAction
0c082fac7b
refactor: remove unused import of qsort() from C library (
2019-07-30 00:10:22 +02:00
Alexander Krotov
03603a48a0
dc_job.rs: add DC_{IMAP,SMTP}_THREAD constants
2019-07-29 20:20:52 +03:00
Alexander Krotov
27342f50b5
Remove unsafe version of dc_timestamp_to_str
2019-07-29 18:45:12 +03:00
Alexander Krotov
2d5b04148f
Make dc_open arguments rusty
2019-07-29 04:05:21 +03:00
Alexander Krotov
dfce34f275
Return bool from is_file_size_okay
2019-07-29 03:14:21 +03:00