Commit Graph

30 Commits

Author SHA1 Message Date
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
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
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
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
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
Dmitry Bogatov
39e530f759 Change Context.os_name field to String 2019-07-31 15:45:35 +00:00
Alexander Krotov
2d5b04148f Make dc_open arguments rusty 2019-07-29 04:05:21 +03:00
Friedel Ziegelmayer
b23ca26908 refactor(chatlist): rustify 2019-07-28 11:32:48 +02:00
Floris Bruynooghe
68888f6d1f Also silence warnings in test code
We can be a bit more liberal with .unwrap() here.
2019-07-21 12:03:04 +02:00
Friedel Ziegelmayer
8a0fc609e6 The big sqlite refactor
* refactor: safe sql access

* Clean up the worst rebase mistakes

* Some more progress on the rebase fallout and this branch

* upgrade and compile again

* cleanup from rebase

* example of how to prepare now

* rebase fixes

* add sql.query_map

* less preparation

* more improvements in sql code

* fix string truncation

* more prepare conversions

* most prep done

* fix tests

* fix ffi

* fix last prepares

* fix segfaults and some queries

* use r2d2 pool

* fix dc_job sql call, to reduce contention

* try newer rust

* No more vararg printing (drop dc_log_)

* ignore expected errors

* fix: uses exists instead of execute where needed

* fix: get_contacts logic was broken

* fix: contact creation

* test on 32bit linux

* ci: try running 32bit without cross

* undo 32bit tests

* refactor: rename dc_sqlite3 to sql

* fix: safer string conversions

* more string fixes

* try fixing appveyor build to 64bit

* chore(ci): hardcode target

* chore(ci): appveyor

* some cleanup work

* try fix darwin

* fix and improve sql escaping

* fix various bugs

* fix chat deletion

* refactor: cleanup config values and move to their own file

* refactor: move more methods onto the sql struct

* dont panic on failed state loading

* first round of cr

* one more cr fix

* stop using strange defaults

* remove unused escapes
2019-07-18 00:24:45 +02:00
Floris Bruynooghe
db9bc15d3e Make the callback optional again
The C API allows passing a NULL pointer is for the callback function.
However when calling the callback nothing checks for this null pointer
and thus things fail badly.  Even worse since the C API is defined
using an "fn pointer" rather than a "*-ptr" or raw pointer to the
function rust does not realise this can be invalid and therefore the
typechecker does not catch this even though there are no unsafe casts.

Fix this by making the callback an Option in rust, this can be easily
checked when calling.  Also add a Context.call_cb() function which
simplifies calling the callback, hides the weird syntax due to the
function pointer and makes the call a little easier.  Finally it also
means the option checking is only needed in one place.

For the C API this needs to check if this is a NULL pointer or not,
this is implicitly done by rust using the "nullable pointer
optimisation":
https://doc.rust-lang.org/nomicon/ffi.html#the-nullable-pointer-optimization
2019-06-17 20:06:15 +02:00
dignifiedquire
22868abe0e refactor: rename dc_context to context 2019-05-27 09:32:50 +02:00
Friedel Ziegelmayer
f0cfcef864 refactor: use reqwest to handle http-get requests
Closes #82
2019-05-27 09:06:55 +02:00
Friedel Ziegelmayer
342e416b4e Ci updates & closer to windows builds
* chore: update some ci

* feat: no more libiconv

* refactor: updates for updated mmime api

* fixup: correct mmime path

* cleanup

* use newer visual studio

* Update appveyor.yml

* unify libc imports and improve windows situation

* refactor: use rust based sleep

* improve cross platform state of types

* docs: update readme badges
2019-05-16 17:16:07 +02:00
dignifiedquire
76f982a1f5 fix: mvbox and sentbox lock contention 2019-05-10 03:39:23 +01:00
dignifiedquire
fc36070f59 implement imap idle 2019-05-06 00:24:49 +02:00
Lars-Magnus Skog
2cf6cde5d1 chore: fix compiler warnings (mut + unused assignments) (#40)
* Stop allowing unused assignments

* test: remove unused assignments in cmdline

* chore: fix compiler warnings in dc_tools.rs

* chore: fix compiler warnings in dc_token.rs

* chore: fix compiler warnings in dc_strencode.rs

* chore: fix compiler warnings in dc_stock.rs

* chore: fix compiler warnings in dc_sqlite3.rs

* chore: fix compiler warnings in dc_simplify.rs

* chore: fix compiler warnings in dc_securejoin.rs

* chore: fix compiler warnings in dc_saxparser.rs

* chore: fix compiler warnings in dc_pgp.rs

* chore: fix compiler warnings in dc_param.rs

* chore: fix compiler warnings in dc_oauth2.rs

* chore: fix compiler warnings in dc_msg.rs

* chore: fix compiler warnings in dc_mimeparser.rs

* chore: fix compiler warnings in dc_mimefactory.rs

* chore: fix compiler warnings in dc_lot.rs

* chore: fix compiler warnings in dc_loginparams.rs

* chore: fix compiler warnings in dc_log.rs

* chore: fix compiler warnings in dc_location.rs

* chore: fix compiler warnings in dc_keyring.rs

* chore: fix compiler warnings in dc_key.rs

* chore: fix compiler warnings in dc_jsmn.rs

* chore: fix compiler warnings in dc_jobthread.rs

* chore: fix compiler warnings in dc_imex.rs

* chore: fix compiler warnings in dc_hash.rs

* chore: fix compiler warnings in dc_e2ee.rs

* chore: fix compiler warnings in dc_context.rs

* chore: fix compiler warnings in dc_contact.rs

* chore: fix compiler warnings in dc_chatlist.rs

* chore: fix compiler warnings in dc_chat.rs

* chore: fix compiler warnings in dc_array.rs

* chore: fix compiler warnings in dc_apeerstate.rs

* chore: fix compiler warnings in dc_aheader.rs

* chore: fix compiler warnings in dc_array.rs

* test: remove compiler warnings in test/stress.rs

* test: reduce compiler warnings in examples/repl/main.rs

* test: std:🧵:sleep_ms() is deprecated

* chore: remove unused variable in dc_sqlite3.rs

* chore: fix compiler warnings in dc_receive_imf.rs

* chore: fix compiler warnings in dc_job.rs

* chore: fix compiler warnings in dc_configure.rs

* Fix formatting
2019-05-05 21:58:59 +02:00
dignifiedquire
2fd38cd533 imap: fetch_from_folder 2019-05-05 00:15:45 +02:00
dignifiedquire
424e9db112 more fetch progress 2019-05-05 00:15:45 +02:00
dignifiedquire
e7d72dfdd4 fix some locking issues, start rust-imap impl 2019-05-05 00:15:45 +02:00
dignifiedquire
313f71a004 it compiles 2019-05-01 23:41:11 +02:00
dignifiedquire
72e9fe6150 start reworking context references and smtp, imap 2019-05-01 23:41:11 +02:00
dignifiedquire
aa32c53a43 fix: compiles on android 32bit 2019-04-28 17:54:23 +03:00
dignifiedquire
e8a79f220e refactor: use architecture dependent sizes 2019-04-28 15:18:30 +03:00
Lars-Magnus Skog
7183a8995e chore: print out data2 for Event::ERROR_NETWORK as well 2019-04-28 00:54:11 +02:00
Lars-Magnus Skog
ab2efb71cc chore: use a temporary path for db in example 2019-04-27 23:22:54 +02:00
dignifiedquire
956609f565 feat: reorg code, and prepare for c bindings 2019-04-27 21:48:22 +03:00