B. Petersen
cde2c9137f
make oauth2.get_addr work
...
oauth2.get_addr is used for gmail-oauth2
to retrieve the address really authorized in the oauth2 process.
2019-10-16 00:57:58 +02:00
björn petersen
120524ae00
Merge pull request #720 from deltachat/make-oauth2-better
...
make oauth2 POST successfully
2019-10-15 18:29:27 +02:00
B. Petersen
c266d2ca0d
use POST instead GET to init or refresh oauth2 tokens
2019-10-15 00:22:37 +02:00
B. Petersen
85fc696975
more specific and distinguishable oauth2 error message
2019-10-15 00:20:08 +02:00
B. Petersen
766d7cbd3a
add some missing comments
2019-10-14 15:11:33 +02:00
björn petersen
a40b99aae0
Merge pull request #709 from deltachat/fix/features
...
fix: disable default features for pgp, by default
2019-10-10 18:32:56 +02:00
B. Petersen
67848e3333
use libc::c_char as i8 and u8 are used differently on x86 and arm
2019-10-10 08:44:31 +02:00
björn petersen
4d79c6e235
Merge pull request #705 from deltachat/safer-strn
...
len-check in strncasecmp()
2019-10-10 01:19:09 +02:00
B. Petersen
bc99d9d196
cargo fmt
2019-10-10 00:39:35 +02:00
B. Petersen
e1fc5863c2
target comments of @hpk42
2019-10-10 00:29:52 +02:00
B. Petersen
f0791149e6
document dc_str_unref()
2019-10-10 00:29:52 +02:00
B. Petersen
297b032bdc
fix doxygen, some rewording
2019-10-10 00:29:52 +02:00
B. Petersen
2c98e91276
target comments of @link2xt
2019-10-10 00:22:50 +02:00
B. Petersen
3270120d16
strncasecmp() compares the given number of characters but not after a 0-byte
2019-10-09 19:00:54 +02:00
björn petersen
de604e744e
Merge pull request #703 from deltachat/fix-strncasecmp
...
fix(mmime): correct implementation of strncasecmp
2019-10-09 17:31:41 +02:00
björn petersen
c1e4d1e7a4
Merge pull request #688 from deltachat/remove-predecessor
...
remove scanning for old Chat-Predecessor header
2019-10-07 02:02:15 +02:00
B. Petersen
dd8744b74e
remove unused import
2019-10-07 01:15:42 +02:00
B. Petersen
710db2ba0a
remove scanning for old Chat-Predecessor header
...
the Chat-Predecessor header was dropped about 10 month ago.
as a replacement, the standard headers are used.
2019-10-07 00:43:43 +02:00
björn petersen
46a71e81a0
Merge pull request #683 from deltachat/outlook_none
...
Fix and refactor Outlook autodiscovery
2019-10-06 15:54:01 +02:00
B. Petersen
1802d7658d
add some tests for dc_create_outgoing_rfc724_mid()
...
as noticed in the last attempts to change the prefix,
this test is missing (as probably many more :)
2019-10-05 22:48:00 +02:00
B. Petersen
275f5d713f
cargo fmt
2019-10-05 22:47:39 +02:00
B. Petersen
e40cfeec58
bubble up sql, get_abs_path errors
2019-10-05 22:47:39 +02:00
B. Petersen
275b4b8d36
bubble up sql-errors in reveive_imf()
2019-10-05 22:47:39 +02:00
B. Petersen
77cef632c7
bubble up update_param() error
...
bubble up the error instead of ignoring it -
but also do not panic as before #673
2019-10-05 22:47:39 +02:00
B. Petersen
db2064de14
use .to_string_lossy() member of Path, CStr etc.
...
instead of calling to_str().unwrap_or_default().
2019-10-05 22:46:29 +02:00
B. Petersen
e251c7b1c8
redo some c-comments
2019-10-05 15:53:18 +02:00
björn petersen
2fe98775f9
Merge pull request #673 from deltachat/dont-panic
...
Don't Panic!
2019-10-05 15:08:15 +02:00
björn petersen
187179d87b
Merge pull request #674 from deltachat/to-lossy
...
always expect bad c-strings
2019-10-05 15:04:32 +02:00
B. Petersen
abfff96cd4
cargo fmt
2019-10-05 12:44:08 +02:00
B. Petersen
735bdd1c20
always use to_string_lossy() for converting c-strings to String
...
the function to_string() is removed;
c-strings may always be badly formatted and this should never lead to a panic.
2019-10-05 00:12:32 +02:00
B. Petersen
9cae075b6f
target detailed checks of @flub
2019-10-04 23:07:34 +02:00
B. Petersen
2317518e5e
cargo fmt
2019-10-04 23:07:34 +02:00
B. Petersen
477af413c6
if in doubt, prefer unwrap_or_default()
...
if the past we had lots of crashes because of unexpected unwrap failures,
mostly related to string.
this commit avoids them eg. for string-conversions that may panic
eg. when encountering a null-byte or by logical programming errors
where an object is assumed to be set but is not under unexpected circumstances.
2019-10-04 23:07:33 +02:00
B. Petersen
93f0f5ccae
rename sql-config-setters to set_raw_config*()
...
the rename is reasonable as the getter is called get_raw_config*()
and to make the functional difference to context.set|get_config() clearer.
2019-10-04 11:18:26 +02:00
B. Petersen
79b92727cc
prefer get_config_bool() where appropriate
...
for db input/output, we still use get_config_int() to convert to/from 0/1.
also for info() we prefer get_config_int() to show the real value.
2019-10-04 11:15:11 +02:00
björn petersen
8dfd04672f
Merge pull request #670 from deltachat/tweak-config
...
tweak config
2019-10-03 21:19:45 +02:00
B. Petersen
a953b494cb
cargo fmt
2019-10-03 17:41:09 +02:00
B. Petersen
dca9afa10b
rename sql.get_config() to sql.get_raw_config() to make clearer that there is not default handling
2019-10-03 17:35:43 +02:00
B. Petersen
23d2d87c24
do not panic on missing or wrong formatted values in the database
2019-10-03 17:15:40 +02:00
B. Petersen
c6b2d640ae
prefer context.get_config() over context.sql.get_config() as the latter does not handle default values.
2019-10-03 17:15:40 +02:00
björn petersen
b4b8a1d15b
Merge pull request #667 from deltachat/resilient-writes
...
more resilient database writes
2019-10-03 14:48:21 +02:00
B. Petersen
d5b92744ed
increase number of simultan database-connections, wait for write if another thread writes
...
- increase the number of simultan database-connections handled by the r2d2 pool.
currently we have already at least 5 threads threads,
but also the ui may call from any thread.
- the busy-timeout for all connections is set to 10 seconds.
this means, if a connection-A wants to write,
but connection B-is already writing,
connection-A waits multiple times a few ms and tries over.
this is repeated until the 10 seconds are accumulated.
2019-10-03 14:09:43 +02:00
björn petersen
75f41bcb90
Merge pull request #658 from deltachat/fix-contact-requests
...
move contact-requests to the beginning of chatlists
2019-10-01 13:29:44 +02:00
B. Petersen
97e1fbc198
move contact-requests to beginning of chatlists
...
contact-requests of non-blocked senders are shown in the chatlist,
so that the user gets aware of them without opening the contact-request-chat.
however, for that, the contact-request virtual-chat-id
must be added to the beginning of the list,
otherwise it won't get noticed by the user.
2019-10-01 12:50:31 +02:00
björn petersen
22d2097132
log all database-migration actions ( #654 )
2019-09-30 20:56:19 +02:00
björn petersen
c376de9b5e
add sticker type ( #653 )
...
* add sticker type
this pr adds the message type 'sticker'.
stickers are handled as normal images
but tagged with the header `Chat-Content: sticker`
it's up to the ui to render these stickers appropriate.
* cargo fmt
2019-09-30 20:55:27 +02:00
B. Petersen
3a16ad89bd
make ffi-string-parameter const
...
typically, nearly all string-parameters in the ffi should be const.
one of the few exceptions is dc_str_unref() that really modifies the given data.
2019-09-28 02:56:27 +02:00
B. Petersen
66897611d9
fix tests according to the changed verification structure
2019-09-28 00:55:36 +02:00
B. Petersen
6888554e9d
use independent verification key
...
there are 3 key blobs in the database, gossip_key, public_key and verified_key.
the verification_key should not change if, for any reasons,
the public_key or the gossip_key changes.
2019-09-28 00:55:36 +02:00
B. Petersen
b73d6377fc
do not truncate messages in contact requests
...
core-c has truncated messages in the contact requests.
this is questionable in general, as
- all messages, including contact requests,
are already truncated, unquoted, simplified etc.
- the ui should be capable of showing the full text anyway
(when the contact request is accepted, the whole messase is shown)
- also, all current ui show the contact requests by name only in the
chatlist; the user often does not even come to the contact request view.
- if the ui wants to show the contact request is a special way,
it is probably better to leave this truncation up to the ui
2019-09-27 02:55:23 +02:00
B. Petersen
1ed543b0e8
adapt group-id length to reality
2019-09-26 20:10:33 +02:00
björn petersen
c61fc59003
Merge pull request #608 from deltachat/fix-get-setupcodebegin
...
fix boolean error that makes get_setupcodebegin() failing
2019-09-25 21:39:48 +02:00
B. Petersen
40f9072250
add get_setupcodebegin to python bindings, test the function
2019-09-25 21:13:05 +02:00
B. Petersen
ea30bb351e
fix boolean error that makes get_setupcodebegin() failing
2019-09-25 20:37:36 +02:00
B. Petersen
321c5e049b
re-add some comments from core-c
2019-09-22 23:39:16 +02:00
björn petersen
1a47c148e5
Merge pull request #574 from KAction/test-dc_remove_cr
...
Add test for `dc_remove_cr_chars`
2019-09-22 19:47:22 +02:00
björn petersen
2435ba1ea0
Merge pull request #576 from KAction/quote_word
...
Remove useless argument to `quote_word`
2019-09-22 19:46:48 +02:00
B. Petersen
6a351de4f9
cargo fmt
2019-09-19 18:42:29 +02:00
B. Petersen
bbff1c9c3e
test that bad credentials do not panic
2019-09-19 18:42:29 +02:00
B. Petersen
bbb8144129
do not panic when 0 (=failure) is passed to the progress! macro
2019-09-19 17:00:01 +02:00
B. Petersen
4f880932ae
change oder of typedefs, function-definitions and defines
...
as c is top-down, we start with the typedefs
so that functions can use them freely.
after that, the functions are declared
and finally the #defines (for less noise in the function sections).
grouping is done by classes.
2019-09-19 12:58:26 +02:00
B. Petersen
62e8c2497c
add missing doxygen commands, fix typo
2019-09-19 12:58:26 +02:00
B. Petersen
00e929afac
reformat: use shorter lines (max. 80 chats) and try to add linebreaks semantically
2019-09-18 15:20:34 +02:00
B. Petersen
8c2c3f8bee
move spec.md from separate repo here
2019-09-17 10:49:34 +02:00
björn petersen
79d23909b5
fix 'this message is not encrypted' error in verified groups ( #522 )
2019-09-14 18:55:19 +02:00
B. Petersen
34433c4962
support additional placeholder in stock-string
2019-09-12 23:44:40 +02:00
björn petersen
e73671a6ff
Merge pull request #485 from deltachat/really-fix-477
...
do not panic on bad-utf-8
2019-09-11 20:14:48 +02:00
björn petersen
9503aca78d
Merge branch 'master' into really-fix-477
2019-09-11 19:52:13 +02:00
björn petersen
dfaa8e4529
Merge pull request #490 from deltachat/fix/location-sql
...
fix(location): do not sql recurse in location sending
2019-09-11 19:40:46 +02:00
björn petersen
cbc3579e9a
Merge pull request #489 from deltachat/no-recursive-delete
...
do not recursive delete folders
2019-09-11 19:39:15 +02:00
B. Petersen
177ab0229a
do not call fs::remove_dir_all() implicitly on non-files; deleting folders is not needed and calling remove_dir_all() is considered harmful
2019-09-11 17:02:27 +02:00
B. Petersen
e9da21a02e
cargo fmt
2019-09-10 19:14:51 +02:00
B. Petersen
6c4d7ad8cc
do not panic on bad-utf-8
2019-09-10 16:48:54 +02:00
björn petersen
3d61c06ea9
Merge pull request #478 from deltachat/fix477
...
fix crash when msg_raw is None
2019-09-10 15:50:33 +02:00
B. Petersen
bf1d9b6d06
fix crash when msg_raw is None
2019-09-10 15:20:38 +02:00
björn petersen
275aa853f5
Merge pull request #471 from deltachat/fix417
...
fix crash when downloading message
2019-09-09 16:18:50 +02:00
B. Petersen
1367873949
check bounds before accessing Vec
2019-09-09 01:47:50 +02:00
B. Petersen
d933183e0a
mark safe functions as such
2019-09-09 01:47:50 +02:00
B. Petersen
7e11def527
make code more readable
2019-09-09 00:01:15 +02:00
björn petersen
2e1bc9b14e
Merge pull request #458 from deltachat/fix-unknown
...
fix reading unknown origin
2019-09-08 12:24:51 +02:00
B. Petersen
c603ca0e7a
remove dead code
2019-09-08 07:26:07 +02:00
B. Petersen
d07ef01204
cargo fmt
2019-09-07 23:25:19 +02:00
B. Petersen
d8630b5029
fix reading of unknown/outdated origin
2019-09-07 22:21:38 +02:00
björn petersen
5663c7dec3
Merge pull request #453 from deltachat/fix-backup
...
Fix backup and housekeeping
2019-09-07 15:38:01 +02:00
björn petersen
06673b2108
Merge pull request #455 from deltachat/fix-msg-loading
...
Fix msg loading
2019-09-07 15:37:38 +02:00
B. Petersen
7f4ef493b9
be tolerant when reading unexpected NULL from the database and treat this as an empty string, compatible to core-c
2019-09-07 13:54:43 +02:00
B. Petersen
d9d0dee0d5
fix: use empty string for messages without text everywhere
2019-09-07 13:40:50 +02:00
B. Petersen
9605370f0b
fix cmdline: sendimage and sendfile really accept only a file
2019-09-07 12:34:31 +02:00
B. Petersen
cc0428aa50
really check all rows when searching for referenced files
2019-09-06 15:15:06 +02:00
B. Petersen
4be481275f
clearer naming
2019-09-06 14:32:17 +02:00
B. Petersen
27732c85af
mark actually safe function as such
2019-09-06 00:55:50 +02:00
B. Petersen
5ffc84eb59
remove unused functions
2019-09-06 00:55:50 +02:00
B. Petersen
50947b81c0
set correct default value for inbox_watch
2019-09-03 15:31:17 +02:00
björn petersen
d6e2798f5a
Merge pull request #416 from deltachat/as_u32
...
Convert DC_*_ID_* constants to u32
2019-09-02 10:22:18 +02:00
björn petersen
8e41037eb1
Merge pull request #422 from deltachat/raw_mime_assert
...
mailmime_get_mime_type: do not dereference null pointer
2019-09-02 10:20:36 +02:00
björn petersen
0bcd3bc94e
Merge pull request #423 from KAction/fix-master2
...
unbreak master
2019-09-02 10:19:57 +02:00
björn petersen
ad36671adb
Merge pull request #414 from deltachat/forgiving-ffi
...
handle ffi-failures compatible to core-c
2019-08-29 21:54:23 +02:00
B. Petersen
8902d0843b
fix some return values
2019-08-28 18:32:34 +02:00
B. Petersen
010ac6a6ac
print message to stderr on careless ffi usage
2019-08-28 18:24:01 +02:00
B. Petersen
c71589a710
handle ffi-failures compatible to core-c
2019-08-28 13:46:47 +02:00