Commit Graph
80 Commits
Author SHA1 Message Date
link2xt d179dced4e Get rid of mod.rs files.
Since Rust 2018 [1] it is no longer required to move module code to
`mod.rs` when submodules are added. This eliminates common problem of
having multiple buffers named `mod.rs` in editor.

[1] https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html#no-more-modrs
2021-04-23 22:45:45 +03:00
link2xt 1dc055fb66 cargo update -p sqlx 2021-04-23 00:00:00 +00:00
link2xt 7bdae8b2c5 README.md: replace shields.io with official CircleCI badge
Also remove appveyor, it is not used anymore.
2021-04-21 07:23:48 +03:00
link2xt 75999c5d5a test_account.py: fix syntax error on python 3.5
It was introduced in 553d3936a9
2021-04-21 02:49:20 +03:00
link2xt 99373774aa search_msgs: do not match contact names
ct.name was insufficient, as authname, overridden name and email address
fallback were not taken into account.

Dropping this condition increases performance by 25% according to the
benchmark.

Also add a test for search_msgs.
2021-04-20 12:21:04 +02:00
link2xt acd51a7058 Sort global message search result only by ID
It reduces the time by ~20% according to `search_msgs` benchmark.

Sorting by IDs is sufficient for global search as IDs increase in the
order of message reception.
2021-04-20 00:35:21 +03:00
link2xt efd0314872 dc_receive_imf: remove unnecessary check for empty folder name
This check dates back to C core, where it checked for NULL, not empty string.
2021-04-19 23:09:17 +03:00
link2xt ef89bc64c9 Add search_msgs benchmark 2021-04-19 23:09:00 +03:00
link2xt 6d4ec75a7b Benchmark reading contact list 2021-04-19 23:09:00 +03:00
link2xt 8af47de5a4 Benchmark adding 500 contacts from address book 2021-04-19 23:09:00 +03:00
link2xt c7345c16f8 README: update CI status badges 2021-04-19 01:23:59 +03:00
link2xt a4b14c6b98 ci: update configs to use scripts from scripts/ directory 2021-04-18 21:57:04 +03:00
link2xt 321354531d Move set_core_version.py into scripts/
Also make it executable.
2021-04-18 21:57:04 +03:00
link2xt 5b0f07f9a7 Move run-integration-tests.sh into scripts/ 2021-04-18 21:57:04 +03:00
link2xt 87cb5de8b1 Rename ci_scripts/ into scripts/ 2021-04-18 21:57:04 +03:00
link2xt baae31117f server_params.rs: increase test coverage 2021-04-18 21:56:10 +03:00
link2xt 004fb76864 Remove println! calls from test_group_with_removed_message_id()
They were accidentally added in 6bb5721f29

Given that they are full of typos, they were probably not meant to be commited.
2021-04-18 18:37:49 +03:00
link2xt 09bc8fc603 dc_tools: remove dead code from the test
Since temporary directory is used, files from previous tests can't exist in blobdir.
2021-04-18 02:57:17 +03:00
link2xt 8f1bb38a3b Fix a comment typo 2021-04-18 02:56:34 +03:00
link2xt 9a34fe5c70 sql: enable shared cache 2021-04-17 23:47:21 +03:00
link2xt e35a8d4415 sql: use sqlite3_last_insert_rowid instead of SELECT 2021-04-17 22:59:34 +03:00
link2xt 69dae4c006 Switch to release version of sqlx 2021-04-16 22:05:21 +03:00
link2xt a795ae98ee Test saving and loading of LoginParam 2021-04-16 21:47:39 +03:00
link2xt ac54301923 mimefactory: resultify is_file_size_okay 2021-04-16 21:47:29 +03:00
link2xt ac9394cb16 dehtml.rs: test </i> tag 2021-04-15 00:30:50 +03:00
link2xt edb9ea0e83 format_flowed.rs: increase line coverage to 100% 2021-04-15 00:30:50 +03:00
link2xt 4c1315446e Add coverage script 2021-04-15 00:30:50 +03:00
link2xt d4e065ee84 Update once_cell, base64, itertools, strum and strum_macros 2021-04-13 02:18:15 +03:00
link2xt bc222af661 Cargo.toml: sort dependencies alphabetically
This is what we do in rPGP too.
2021-04-13 02:18:15 +03:00
link2xt 244260a978 Fix nightly clippy and rustc errors 2021-04-12 21:33:52 +03:00
link2xt 1cd53aafff Add support for "Mixed Up" MIME format
This is an PGP/MIME format produced by Microsoft Exchange and ProtonMail IMAP/SMTP Bridge,
described in detail in https://tools.ietf.org/id/draft-dkg-openpgp-pgpmime-message-mangling-00.html

This patch adds seamless support for "Mixed Up" Encryption, repairing
mangled Autocrypt messages without notifying the user.
2021-04-11 19:50:59 +03:00
link2xt 4d2ac5a3a2 ci: switch to v2 of actions/checkout 2021-04-11 14:45:27 +03:00
link2xt 146db48c35 ci: use DCC_NEW_TMP_EMAIL for remote python tests 2021-04-11 14:45:27 +03:00
link2xt 9529d76d82 ci: update ci_scripts README 2021-04-11 14:45:27 +03:00
link2xt b5f2752e41 python: remove DCC_PY_LIVECONFIG references from all scripts
This variable is not used anymore.
2021-04-11 14:45:27 +03:00
link2xt ce4675e9f7 ci: move remote python tests from CircleCI to GitHub Actions 2021-04-11 14:45:27 +03:00
link2xt f0bd129636 ci: fix syntax of git --format in run-doxygen.sh
git version 2.31.0 throws fatal error on --format without "="
2021-04-11 14:45:27 +03:00
link2xt dfe3cabb14 circleci: remove remote_tests_rust
Rust tests are already running on GitHub Actions, this is duplicate work.
2021-04-11 14:45:27 +03:00
link2xt 09735b808e circleci: remove unused jobs 2021-04-11 14:45:27 +03:00
link2xt 37f68459f6 sql: make all queries persistent and update to upstream sqlx
&str queries are not persistent by default.  To make queries persistent,
they have to be constructed with sqlx::query.

Upstream sqlx does not contain the change that make all queries
persistent, but it is not needed anymore. but
2021-04-10 22:24:12 +02:00
link2xt 53dba3c1ba Merge in sqlx fixes 2021-04-08 22:54:58 +03:00
link2xt 6540ee60e5 Update Cargo.lock 2021-04-08 22:05:15 +03:00
link2xt 66b5084a1d Switch to /deltachat/ org fork of sqlx 2021-04-08 21:58:04 +03:00
link2xt f76aaf3205 sql: enable virtual statement cache on the reader pool
A follow-up to 720135a915
2021-04-07 21:43:34 +03:00
link2xt 720135a915 Update sqlx to enable statement cache 2021-04-07 12:41:23 +03:00
link2xt 4dedc2d8ce Fix a comment typo 2021-03-27 21:11:34 +03:00
link2xt ede9bdc018 Reduce required cmake version to 3.16 2021-03-27 00:17:04 +03:00
link2xt cdc1063d83 Do not reset user status after receiving a read receipt
Read receipts never contain the signature, so previously receiving it
cleared the status.
2021-03-21 18:54:08 +03:00
link2xt 04f816be31 qr: return QrFprMismatch on fingerprint mismatch
Previously QrFprWithoutAddr was returned incorrectly.

Also fix spelling error ("Missmatch").
2021-03-15 21:39:10 +03:00
link2xt a698a8dd84 Update to Rust 1.50
Also run rustfmt, fix new clippy warnings.
2021-03-01 16:48:33 +03:00
link2xt 5535475cc9 Reduce required cmake version 2021-02-28 18:19:03 +03:00
link2xt f8755b505e Fix clippy::unnecessary_wraps warnings
This lint is enabled by default in 1.50 toolchain.
2021-02-25 12:35:45 +03:00
link2xt 6dab25e5fb Add CMakeLists.txt
This allows to install the library system-wide or use it with build systems that support CMake, such as kdesrc-build.
2021-02-24 00:07:07 +03:00
link2xt 57a6f27c87 Remove dc_tools::listflags_has
It was not even doing what the documentation says: the implementation
worked correctly only for bitindex=1 and bitindex=2.
2021-02-16 15:33:53 +03:00
link2xt 88a9a13795 tox.ini: pin sphinx version to fix CI 2021-02-16 11:19:20 +01:00
link2xt 2865ced3c0 color: prevent rare overflow if some component is exactly 1.0 2021-02-15 20:04:59 +03:00
link2xt 57841cdcc0 Remove &Context from Peerstate and MimeParser
Passing Context around explicitly removes the need for explicit lifetimes.
2021-02-14 14:19:55 +03:00
link2xt 7404e8c85f Return PartBuilder vector from MimeFactory.render_message()
This will allow MimeFactory.render() to put protected headers
into main_part and wrap it into single-part multipart/mixed if
protected headers are too large to put into the outermost IMF.
2021-02-14 14:19:55 +03:00
link2xt a24b607640 refactor: less mut variables in MimeFactory::render() 2021-02-14 14:19:55 +03:00
link2xt a88893f262 clippy: fix needless_borrow 2021-02-14 00:55:23 +03:00
link2xt a2c3233c19 Implement Consistent Color Generation (XEP-0392)
This should make colors used by Delta Chat for emails similar to colors
used by XMPP clients implementing the same specification[1], such as
Conversations and Snikket.

Previously Delta Chat used only hardcoded 16 colors, so this change
should also increase the number of colors and make it easier to
distinguish different contacts.

[1] https://xmpp.org/extensions/xep-0392.html
2021-02-13 03:09:08 +03:00
link2xt 40d9a1ec22 Do not return quoted messages from the trash chat 2021-02-12 10:47:47 +01:00
link2xt 0601b05cb7 Use footer as a contact status 2021-02-11 13:57:49 +03:00
link2xt e82ec23024 python: support location markers 2021-02-10 08:36:56 +01:00
link2xt 3f9242a610 Fix contact name update rules
The following rules apply now:
1. "name" column is only updated manually and never over the network
2. "authname" column is only updated over the network and never manually
3. Displayname is a "name" if it is non-empty, otherwise it is "authname".

This fixes a known (pytest.xfail) problem of "name" being changed over
the network when user has set it to non-empty string manually.

This also fixes the problem when "name" and "authname"
became unsynchronized accidentally, when they were equal and then
Origin::IncomingUnknownTo update arrived, setting "name" but not
"authname". Rust regression test is added for this case.
2021-02-09 17:44:25 +03:00
link2xt a2d64cbb4c Show sender name override in chatlist summary 2021-02-09 10:54:13 +01:00
link2xt 0cd8710289 Add dc_get_chat_encrinfo() 2021-02-07 20:29:43 +03:00
link2xt fbec12393d Improve dc_get_contact_encrinfo()
Return error for special IDs. Previously "No encryption." was returned for DC_CONTACT_ID_SELF.

Show "No encryption." if peerstate is reset.

Never talk about transport encryption: it is misleading. Even if TLS is used for client IMAP and SMTP connections, MTA-MTA connection may be unencrypted if MX does not support STARTTLS.

Add a Rust test.
2021-02-07 20:29:43 +03:00
link2xt dc893bf5cd fake_idle: unwrap watch_folder early to avoid doing it in a loop
This also makes info message "IMAP-fake-IDLEing folder=..." nicer,
because the folder name is not wrapped into Some() anymore.
2021-02-05 19:57:42 +03:00
link2xt 6bb0c164f9 Parse QR codes without using Param
Param should only be used to parse dictionaries stored in SQL database, not external data.

Since Param parser has been extended to escape newlines with newlines, QR-codes parser started to treat && as escaped &, which is wrong.

This change also uses String keys like "n" for "name" instead of completely unrelated constants like Param::SetLongitude.
2021-02-03 21:26:23 +03:00
link2xt 93bd9422e7 Improve formatting of ephemeral timer change messages
This adds support for more timer values and better fallback for unknown values.

For example, 90 seconds is formatted as "1.5 minutes".
2021-01-31 00:44:57 +03:00
link2xt b53415fed5 ffi: add missing DC_STR_SERVER_TURNED_OFF #define 2021-01-31 00:44:57 +03:00
link2xt 47a6e31047 fix: allow emojis for location markers
is_marker() should check for length in characters,
not bytes.

This was broken during the Rust translation
in changeset a5553f98af
2021-01-28 00:56:35 +03:00
link2xt c8c2724c28 Apply gossiped encryption preference to new peerstates
Encryption preference was already applied since commit 78d855c5ca,
but only for already existing peerstates.

As a result, new users ignored gossiped encryption preference in the
"member added" message and had to wait until someone gossiped encryption
preferences for inactive users the second time.
2021-01-26 23:18:36 +03:00
link2xt 564d681bca Try to extract group ID from In-Reply-To and References as a last resort
This should help if parent message can't be found because messages were
reordered or deleted.

This does not prevent group IDs from being removed from Message-IDs in
the future, in which case it will become dead code.
2021-01-26 03:00:13 +03:00
link2xt c469798734 Assign classic replies to two-member groups to group chat
Previously it was assigned to 1:1 chat.

To keep "reply privately" working, old behavior is retained for chat messages.
2021-01-26 02:56:57 +03:00
link2xt 7b5a3a8346 Stop extracting group IDs from Message-IDs 2021-01-24 01:24:39 +03:00
link2xt 3d072a81b4 Assign replies to chats based on In-Reply-To and References 2021-01-24 01:24:39 +03:00
link2xt 3fe5eb31d4 Remove member list heuristic for ad-hoc groups
It is going to be replaced by simpler and more reliable
matching by the parent message.
2021-01-24 01:24:39 +03:00
link2xt b938d5facd add_parts: call get_parent_message only once 2021-01-24 01:24:39 +03:00