Commit Graph
100 Commits
Author SHA1 Message Date
Alexander Krotov ac72280e69 Hide SIJÚ messenger footer 2020-08-08 00:24:08 +03:00
Alexander Krotov a3ecbb3809 ci: test REPL with cargo check 2020-08-07 15:58:29 +03:00
Alexander Krotov 3c8e60a2a3 dc_set_chat_mute_duration: avoid panic on overflow 2020-08-06 18:48:22 +03:00
Alexander Krotov 7eb72fea92 peerstate: add regression test
Test that default values for acpeerstate table can be successfully
loaded from the database.
2020-08-06 13:19:36 +03:00
Alexander Krotov 5bfa82e7ec Resultify Peerstate::from_fingerprint 2020-08-06 13:19:36 +03:00
Alexander Krotov cfd222a109 Resultify Peerstate::from_addr 2020-08-06 13:19:36 +03:00
Alexander Krotov 3577491b31 peerstate: log database errors 2020-08-06 13:19:36 +03:00
Alexander Krotov d106a027c7 Make Peerstate.save_to_db atomic
This should prevent creation of acpeerstate entries using default values
(empty strings) for fingerprint columns.
2020-08-06 13:19:36 +03:00
Alexander Krotov dc4fa1de65 peerstate: ignore invalid fingerprints in SQL
Normally NULL is used when there is no fingerprint, but default value
for fingerprint columns is an empty string.

In this case, loading should not fail with an "invalid length" error,
but treat the fingerprint as missing.

Strict check was introduced in commit ca95f25639
2020-08-06 13:19:36 +03:00
Alexander Krotov f480c65071 Compress icon-saved-messages.png
Used oxipng --nx --zopfli
2020-08-05 21:28:49 +03:00
Alexander Krotov a315f919e4 Update device chat icon to use RGBA 2020-08-05 21:24:42 +03:00
Alexander Krotov a9794b73de Update async-imap 2020-08-04 12:45:34 +03:00
Alexander Krotov 38dfe2a320 Update async-smtp
This change fixes timeout issues with large files.
2020-08-04 12:00:00 +03:00
Alexander Krotov b23fe6d976 Do not accept protected From headers
Signatures are checked for unprotected From, so it should not be modified
afterwards.
2020-08-02 18:24:09 +03:00
Alexander Krotov a4ca9f738b Update the comment in encrypted message branch
Since try_decrypt does not check if the message has valid signatures
anymore, it may return empty signatures set, which means the message is
not a valid autocrypt message.
2020-08-02 16:23:13 +03:00
Alexander Krotov 63dd3c91e1 python tests: do not enable strict certificate checks by default
Since introduction of provider database, these certificate checks are
enabled for test servers anyway, but this setting prevents usage of
local servers with self-signed certificates.
2020-07-28 01:40:35 +02:00
Alexander Krotov 8729b9f403 Allow http scheme for DCACCOUNT URLs
It presents no security issue, because properly configured servers will
only serve passwords on HTTPS and distribute only HTTPS QR codes, but
makes testing easier when HTTPS is not easy to deploy.

If attacker can control the URL used, they can change the URL to another
HTTPS URL controlled by them and act as a proxy between the client and
original server anyway.
2020-07-28 01:37:04 +03:00
Alexander Krotov d1b93f6978 configure: compare mail_port to 143
143 is an IMAP, not SMTP port
2020-07-28 00:00:00 +03:00
Alexander Krotov 82c3352b27 dc_receive_imf: do not create adhoc groups when group ID is known
Adhoc groups for group messages that don't have Chat-Group-ID are already
created above in another create_or_lookup_adhoc_group.

At this point it could be that there is a valid Chat-Group-ID header,
but no group was created because removed_id was non-zero i.e. received
message removes some group member.

If group was not explicitly left, current code creates an adhoc group
instead of trashing late or reordered messages that remove group
members. Such groups have adhoc group IDs locally, but proper group
message-IDs.  Attempts to reply to such groups or leave them creates
"split groups" for all other members of original group. The solution is
not to create adhoc groups in this case.
2020-07-27 20:23:00 +03:00
Alexander Krotov dc065ccbe3 Do not send read receipts for system messages 2020-07-27 01:47:10 +03:00
Alexander Krotov dafe900d22 empty_server: use configured inbox instead of hardcoded "INBOX" 2020-07-26 23:53:56 +03:00
Alexander Krotov a860758f8a Remove OldDeleteMsgOnImap job type 2020-07-26 19:23:47 +03:00
Alexander Krotov aace6bad2f Fix a typo 2020-07-25 20:40:30 +03:00
Alexander Krotov b4c412ee68 Refine SMTP error handling
Permanent error 550 5.1.1 is no longer considered temporary.
Enhanced status code is checked now, so only 550 5.5.0 is an exception
for misconfigured Postfix servers.

Yandex error 554 5.7.1 was handled correctly, but only because it had
response code 554, while the comment talks about enhanced status code
5.7.1. The comments are corrected.

Failed messages are now marked as such with message::set_msg_failed.
Previously they were left in a pending state.

If info message cannot be added to the chat, the error is displayed with
error! instead of being logged with warn!.
2020-07-23 08:48:52 +03:00
Alexander Krotov bf8e83d816 Update itertools 2020-07-22 23:51:59 +03:00
Alexander Krotov 6594fdf33a ci: allow nightly runs to fail 2020-07-22 19:57:17 +03:00
Alexander Krotov 71c7b30db7 Remove image_meta dependency 2020-07-22 00:25:54 +03:00
Alexander Krotov 60b3550952 Fix clippy errors 2020-07-20 13:06:58 +02:00
Alexander Krotov 35542189d8 deltachat-ffi: convert clippy warnings to errors 2020-07-20 13:06:58 +02:00
Alexander Krotov 3bde37eabf ci: replace deprecated --workspace with --all 2020-07-20 13:06:58 +02:00
Alexander Krotov 632416cf58 ci: check all packages in the workspace 2020-07-20 13:06:58 +02:00
Alexander Krotov 861325591e Remove outdated references to nightly. 2020-07-19 23:38:01 +03:00
Alexander Krotov 1c73021d77 Update rust toolchain to 1.45.0 2020-07-17 01:08:32 +03:00
Alexander Krotov 6067d40a6f cargo fmt 2020-07-16 11:55:51 +02:00
Alexander Krotov cde587fefa idle: drain unsolicited response channel
This prevents multiple unsolicited messages from skipping multiple IDLEs.
Also skip IDLE only if an EXISTS message was received.
2020-07-16 11:55:51 +02:00
Alexander Krotov f461e2a2fd import_backup: do not load all blobs into memory at once 2020-07-16 10:58:52 +02:00
Alexander Krotov 667364b90e Mark location-only messages as auto-generated 2020-07-15 02:16:20 +03:00
Alexander Krotov 7bb6890f26 Send MDNs for messages deleted on the server
Now MarkseenMsgOnImap sends MDN even if it can't mark the message as
seen on the server.

To prevent multiple MDNs from being sent, MarkseenMsgOnImap is postponed
until the message is detected in a folder from which it is not going to
be moved.
2020-07-14 23:26:48 +03:00
Alexander Krotov 2aa808756e Add test for MDN not sent for server deleted messages 2020-07-14 23:26:48 +03:00
Alexander Krotov 81a2e510f5 Move proxy.py from scripts/ to contrib/
This change makes it clear that core does not depend on this code.
2020-07-14 20:41:38 +02:00
Alexander Krotov 6902250d6b securejoin: do not check the signatures existance twice
Mimeparser.was_encrypted() checks if the message is an Autocrypt encrypted
message. It already means the message has a valid signature.

This commit documents a few functions to make it clear that signatures
stored in Mimeparser must be valid and must always come from encrypted
messages.

Also one unwrap() is eliminated in encrypted_and_signed(). It is possible
to further simplify encrypted_and_signed() by skipping the was_encrypted()
check, because the function only returns true if there is a matching
signature, but it is helpful for debugging to distinguish between
non-Autocrypt messages and messages whose fingerprint does not match.
2020-07-13 12:36:14 +02:00
Alexander Krotov 6cb75114c1 Cleanup test_basic_imap_api() 2020-07-13 01:53:28 +03:00
Alexander Krotov d54ade5891 Start ephemeral timer for non-fresh messages 2020-07-13 01:20:16 +03:00
Alexander Krotov 0da21aa9f6 dc_receive_imf: rename timer into ephemeral_timer 2020-07-13 01:15:51 +03:00
Alexander Krotov 1e84e81e7d imap: expunge folder before IDLE if needed
This ensures Inbox is expunged timely in setups that don't watch
DeltaChat folder.
2020-07-13 00:54:20 +03:00
Alexander Krotov d3eb209d27 Add test for immediate server deletion 2020-07-13 00:54:20 +03:00
Alexander Krotov 49a6a5b23c testplugin.py: print HTTP response text on error 2020-07-12 22:58:57 +03:00
Alexander Krotov 4f78e2e14e Do not show an error on IMAP connection failure
It is annoying as it happens every time the server is rebooted.
2020-07-12 17:17:26 +02:00
Alexander Krotov 7da69a4644 Add dc_msg_get_ephemeral_{timer, timestamp}() 2020-07-11 22:25:17 +03:00
Alexander Krotov 8efe7cade7 Rename part_mut into part 2020-07-11 21:43:02 +03:00
Alexander Krotov 18e4abc1df Remove some and deny new indexing and slicing 2020-07-11 21:43:02 +03:00
Alexander Krotov e2c532704a Fix documentation typo 2020-07-11 00:04:38 +03:00
Alexander Krotov f28a0db7d0 Store typed timer in ChatEphemeralTimerModified event 2020-07-10 02:55:17 +03:00
Alexander Krotov e5d5009d6a Emit ChatEphemeralTimerModified when user changes the timer 2020-07-10 02:52:45 +03:00
Alexander Krotov 0ae8663eed imap: call dc_receive_imf sequentially
Parallel processing of messages results in bugs such as messages sent by
a new member being processed before the message that adds this member to
the chat, even when it has lower UID. In this case, messages are shown as
"[Unknown sender for this chat. See 'info' for more details.]", while
there is a message "Member ... added" right before, because writing the
information about new member to the database takes longer then reading
old index from the database.
2020-07-10 00:40:52 +03:00
Alexander Krotov d1ec0e2de6 Fix Chatlist::try_load() doc comment 2020-07-09 23:19:33 +03:00
Alexander Krotov 7f8f871813 Make ephemeral timer changes not ephemeral 2020-07-08 20:25:05 +03:00
Alexander Krotov 43c4816739 Display source for IMAP IDLE errors 2020-07-08 01:32:49 +03:00
Alexander Krotov 1b5d08e6ee Start ephemeral timers during housekeeping 2020-07-08 01:16:01 +03:00
Alexander Krotov bb9603661a Fix a typo 2020-07-07 22:38:50 +03:00
Alexander Krotov d9314227ee Do not duplicate system messages about timer changes
Instead, replace them with localized stock strings using set_better_msg.
2020-07-02 14:20:55 +03:00
Alexander Krotov 6050f0e2a1 Always schedule next ephemeral task after message deletion
If no messages were deleted, it means the task was scheduled earlier
then needed and should be rescheduled.
2020-07-01 22:18:36 +03:00
Alexander Krotov d4dea0d5c6 Schedule ephemeral task 1 second later
This accounts for 1-second rounding, otherwise the task is always too early.
2020-07-01 22:18:36 +03:00
Alexander Krotov 0b187131b2 Cargo.toml: disable LTO 2020-07-01 20:35:50 +03:00
Alexander Krotov 5a28b669f9 Set ephemeral timer for info messages 2020-07-01 20:32:37 +03:00
Alexander Krotov d59475f9bb Fix a typo in UnknownSenderForChat 2020-07-01 19:11:48 +03:00
Alexander Krotov db6623d0cf Add stock strings for ephemeral timer changes 2020-07-01 12:31:51 +03:00
Alexander Krotov 059caee527 Add "by me" to "Ephemeral message timer changed to"
Otherwise this message looks different on other devices of the sender.
2020-07-01 12:31:51 +03:00
Alexander Krotov 97599bd78e dc_array: remove unused binding 2020-07-01 12:31:11 +03:00
Alexander Krotov d6b30c9703 Fix python test for ephemeral timer 2020-07-01 09:32:08 +03:00
Alexander Krotov 7a7dcc8b8f constants.rs: remove unused DC_STR_* constants
They are also outdated.
2020-07-01 07:55:22 +03:00
Alexander Krotov d79c918c9e Replace 1 with DC_CONTACT_ID_SELF 2020-07-01 00:59:07 +03:00
Alexander Krotov 56518420bc Add get_marker method to dc_array_t 2020-06-30 01:21:18 +03:00
Alexander Krotov 615a76f35e Add timestamp to DayMarker
With this change, API user does not need to look at the timestamp of
the next message to display the day marker, but can get the timestamp
directly from the marker. This way there is no database query and no
risk of error as a result of database being busy or message being deleted.
2020-06-30 01:21:18 +03:00
Alexander Krotov 0c47489a3b Use ephemeral::Timer in MsgId.ephemeral_timer() method 2020-06-29 23:04:34 +03:00
Alexander Krotov f931a905a7 Remove useless comment 2020-06-29 23:04:34 +03:00
Alexander Krotov 7d048ac419 Add autodelete timers 2020-06-29 23:04:34 +03:00
Alexander Krotov 41fe3db79d Add ChatItem type
ChatItem can represent markers as enum variants instead of special MsgIds.
2020-06-29 00:30:17 +03:00
Alexander Krotov 42f6a7c77c Remove dc_array_get_raw
It does not work with typed arrays, such as locations and messages.

Use dc_array_get_id in a loop instead.
2020-06-26 01:22:10 +03:00
Alexander Krotov 09833eb74d dc_array: introduce MsgIds variant
This avoids allocation of u32 vector.
2020-06-26 01:22:10 +03:00
Alexander Krotov 2c11df46a7 dc_array: remove unnecessary "as u32" cast 2020-06-26 01:22:10 +03:00
Alexander Krotov 443ad04f46 Mark all dc_array method as pub(crate)
This make it easier to find unused methods.
2020-06-26 01:22:10 +03:00
Alexander Krotov f2d09cc51e dc_array: simplify and test search_id
This also makes it possible to search for location IDs.
2020-06-26 01:22:10 +03:00
Alexander Krotov 83dde57afa Remove unused dc_array methods 2020-06-26 01:22:10 +03:00
Alexander Krotov fdacf98b69 handle_mdn: compare from_id to DC_CONTACT_ID_LAST_SPECIAL
DC_MSG_ID_LAST_SPECIAL has the same value, but from_id is not a msg id.
2020-06-26 01:11:15 +03:00
Alexander Krotov 93797bc82f Switch to sanitize-filename-reader-friendly
One advantage is that it does not depend on any crates, so there is a
higher chance of dropping regex crate eventually.
2020-06-23 14:37:35 +03:00
Alexander Krotov a031151587 Fix two +nightly clippy suggestions 2020-06-23 03:17:07 +03:00
Alexander Krotov 8de1bc6cbd sql: fix potential panic in maybe_add_file
When maybe_add_file was called with "$BLOBDIR" it tried to remove 9
bytes from the string, while it only contains 8.
2020-06-22 13:22:37 +03:00
Alexander Krotov cf09942737 deltachat-ffi: use as_deref() as suggested by clippy 2020-06-22 12:37:29 +03:00
Alexander Krotov e3af3a24a8 README: add link to Free Pascal bindings 2020-06-21 20:14:30 +03:00
Alexander Krotov 7bfadb14ea Fix a typo (prover -> provider) 2020-06-21 20:13:06 +03:00
Alexander Krotov 2a623541d7 configure/mod.rs: forbid indexing and slicing 2020-06-19 14:24:53 +03:00
Alexander Krotov 0007e93e80 scheduler: forbid indexing and slicing 2020-06-19 14:24:53 +03:00
Alexander Krotov c655fd8a64 contact: forbid indexing and slicing 2020-06-19 14:24:53 +03:00
Alexander Krotov ad531876fd contact: simplify name normalization
This removes one indexing operation and reduces surprises when comma
means something other than first name and last name separator.
2020-06-19 14:24:53 +03:00
Alexander Krotov 53bee68acb smtp/mod.rs: forbid indexing and slicing 2020-06-19 00:56:01 +03:00
Alexander Krotov b5400cf551 Refactor imap/mod.rs to avoid indexing
Also replace assert! with debug_assert!
2020-06-19 00:56:01 +03:00
Alexander Krotov baba91c054 pgp: refactor and document pk_decrypt()
Avoid unnecessary indexing, decompress only once and check if the message
is Signed before trying to verify it.
2020-06-17 11:48:29 +03:00
Alexander Krotov 7d80179ed1 Re-enable lto=true for release builds 2020-06-16 23:12:07 +03:00
Alexander Krotov f7c7f414ed refactor: remove .unwrap() from Peerstate.has_verified_key() 2020-06-15 00:47:25 +03:00