Commit Graph

450 Commits

Author SHA1 Message Date
link2xt 7e5a8714a0 Add scripts/codespell.sh and spellcheck 2023-03-03 18:40:36 +00:00
iequidoo b149df1993 test_{delete,trash}_multiple_messages: Continue waiting for events if not all messages disappeared 2023-02-28 15:05:47 -03:00
link2xt d1d43e889a python: add more type annotations 2023-02-27 13:07:35 +00:00
iequidoo 604c4fcb71 Delete messages to the Trash folder for Gmail by default (#3957)
Gmail archives messages marked as `\Deleted` by default if those messages aren't in the Trash. But
if move them to the Trash instead, they will be auto-deleted in 30 days.
2023-02-20 14:09:27 -03:00
link2xt 7a6bfae93b Fix typo 2023-02-16 11:42:59 +00:00
link2xt cd3f1fe874 python: autoformat with black 2023-02-15 17:15:43 +00:00
link2xt 4f68e94fb3 python: use f-strings instead of percent-encoding 2023-02-15 16:33:05 +00:00
link2xt b3ecbbc8b3 python: do not import print function in tests 2023-02-15 16:32:19 +00:00
link2xt 817760a6ef python: upgrade from .format() to f-strings
They are supported since Python 3.5.
2023-02-08 15:44:34 +00:00
link2xt f2f5bfd17c Fix python file code style
New version of `black` complains otherwise.
2023-02-01 16:10:08 +00:00
iequidoo 4c5ed3df2c Add a test for verified groups with multiple devices on a joining side (#3836)
There was the following bug:
- Bob has two devices, the second is offline.
- Alice creates a verified group and sends a QR invitation to Bob.
- Bob joins the group.
- Bob's second devices goes online, but sees a contact request instead of the verified group.
- The "member added" message is not a system message but a plain text message.
- Sending a message fails as the key is missing -- message info says "proper enc-key for <Alice>
  missing, cannot encrypt".
2023-01-25 20:28:49 -03:00
link2xt fac7b064b4 Refine Python CI
Add lint environment to `deltachat-rpc-client/`
and set line length to 120, same as in `python/`.

Switch from flake8 to ruff.

Fix ruff warnings.
2023-01-20 16:53:21 +00:00
iequidoo 3cf78749df Emit DC_EVENT_MSGS_CHANGED for DC_CHAT_ID_ARCHIVED_LINK when the number of archived chats with
unread messages increases (#3940)
2023-01-16 16:05:47 -03:00
iequidoo 5f883a4445 Prepare to remove "vc-contact-confirm-received", "vg-member-added-received" messages from Securejoin
protocol
2023-01-12 15:13:30 -03:00
iequidoo 57d7df530b Add a test that a new verified member is seen on the second device going online (#3836)
- Alice has two devices, the second is offline.
- Alice creates a verified group and sends a QR invitation to Bob.
- Bob joins the group and sends a message there. Alice sees it.
- Alice's second devices goes online, but doesn't see Bob in the group.
2023-01-12 15:13:30 -03:00
link2xt e215b4d919 Return Option from Contact::add_or_lookup()
This allows to distinguish exceptions,
such as database errors, from invalid user input.
For example, if the From: field of the message
does not look like an email address, the mail
should be ignored. But if there is a database
failure while writing a new contact for the address,
this error should be bubbled up.
2023-01-10 20:43:20 +00:00
Rafael Diniz 4e943d52e4 Add mappings for some file types to Viewtype / MIME type
Namely: ppt, pptx, xls, heif, heic, avif, txt.
But use Viewtype::File for medias without uniform support on all platforms.
2022-12-29 08:37:31 -03:00
Sebastian Klähn c562d17925 Add verifier information (#3839)
* add verifier information

* cleanup

Co-authored-by: bjoern <r10s@b44t.com>

* finish name change

* simple improvements & new ffi

* fixs

Co-authored-by: bjoern <r10s@b44t.com>
Co-authored-by: septias <xxsebastian.kleahnxx@gmail.com>
2022-12-27 10:41:15 +00:00
iequidoo de96500c1a Add a test on reactions after a reordering MOVE to DeltaChat folder (#3756) 2022-12-04 04:40:11 +04:00
iequidoo 9783da5d8e receive_imf: trim() "Chat-Group-Name{,-Changed}:" headers content (#3650)
It's a w/a for "Space added before long group names after MIME serialization/deserialization"
issue. DC itself never creates group names with leading/trailing whitespace, so it can be safely
removed. On the sender side there's no trim() because group names anyway go through
improve_single_line_input(). And I believe we should send the exact name we have in our db. Also
there's no check for leading/trailing whitespace because there may be existing user databases with
group names having such whitespaces.
2022-11-24 08:18:36 -03:00
iequidoo 0b44886b62 Add a test for bug "Partially downloaded messages are received out of order" (#3688)
+ add Message.download_state property.
2022-11-23 23:51:50 +04:00
Hocuri 06b376d242 Bugfix: Don't let malformed From: headers block the receiving pipeline (#3769)
That's a bug which @Simon-Laux and probably also @hpk42 had, where one malformed incoming (Spam-) mail blocked the receiving of all emails coming after it.

The problem was that from_field_to_contact_id() returned ContactId::UNDEFINED, and then lookup_by_contact() returned Err.
2022-11-22 21:10:26 +01:00
bjoern c1f9d8f7a1 allow deleting referenced contacts in UI (#3751)
* allow deleting referenced contacts in UI

we are quite often getting requests of users
who want to get rid of some contact in the "new chat" list.
there is already a "delete" option,
but it does not work for referenced contacts -
however, it is not obvious for users that a contact is in use,
esp. of some mailing list or larger chat, old contacts, whatever.

this pr revives an old idea [^1] of "soft deleting" referenced contacts -
this way, the user can remove the annoying entry
without the need to understand complicated things
and finally saying that deletion is impossible :)

once the contact is reused, it will reappear,
however, this is already explained in the confirmation dialog of the UIs.

technically, this pr was simpler as expected as we already have
a Origin::Hidden, that is just reused here.

[^1]: https://github.com/deltachat/deltachat-core/pull/542

* update rust doccomment

* update changelog

* avoid races on contact deletion

chats may be created between checking for "no chats" and contact deletion.

this is prevented by putting the statement into an EXCLUSIVE transaction.

* fix failing python test
2022-11-15 11:02:47 +01:00
link2xt 17276179e7 python: fix test_getinfo after bcc_self default change 2022-09-25 10:29:48 +00:00
link2xt 335d780f3e Fix Python test for bcc_self 2022-09-25 10:09:26 +00:00
link2xt 5b518e588f Remove StockMessage.action_by_contact() (#3518)
Use separate strings for "... by me" and "... by contact"
to make them easier to translate.
2022-09-11 20:38:34 +02:00
missytake 8533057881 python tests: actually the contacts aren't unified with AEAP
This reverts commit 0aaa33a0d2fd75ff6297ba681ed9de4127bbc995.
2022-08-15 01:07:42 +02:00
missytake 6aa5c60963 tests: ensure that contact of ac1 stays the same 2022-08-15 01:07:42 +02:00
missytake f548b248eb use a verified group for the AEAP test 2022-08-15 01:07:42 +02:00
missytake 5e06568ac6 python test for AEAP flow 2022-08-15 01:07:42 +02:00
missytake c9fc353b60 actually, since AEAP it's fine if the addr changes 2022-08-15 01:07:42 +02:00
link2xt d72cf3fb43 mimeparser: set is_system_message for "group image changed" messages 2022-07-24 13:05:14 +00:00
link2xt ed5fc820c2 python: move most of setup.py to pyproject.toml 2022-07-14 14:39:39 +02:00
link2xt 4f2c68e5a4 Accept more error variants in nicer_configuration_error
musl libc returns "failed to lookup address information: Name does not resolve" in some cases.
2022-07-06 22:58:56 +00:00
link2xt 548335082b Use AUDITWHEEL_PLAT variable
manylinux images set AUDITWHEEL_PLAT variable
which is used as a default --plat value by auditwheel.
2022-06-25 21:13:07 +00:00
link2xt b88042a902 python: display configuration failure error
When configure fails, display error comment in pytest failure message.
2022-06-20 12:39:39 +00:00
link2xt becbb03d80 python: don't use devnull@testrun.org in test_add_remove_member_remote_events()
Otherwise testrun.org refuses to send the message at all,
because it knows devnull@testrun.org does not exist,
and the message doesn't reach ac2.
2022-06-19 17:09:02 +00:00
adbenitez a96a4362cd add missing Message API 2022-06-10 07:57:17 -04:00
adbenitez f94d7d9ea5 add tests 2022-06-10 02:30:37 -04:00
Asiel Díaz Benítez 4f02c811a3 update python API (#3394) 2022-06-04 18:12:38 +02:00
adbenitez 17aab01eaa apply black with new line-length == 120 2022-05-31 23:05:20 -04:00
adbenitez 16e0f0e986 apply isort and black formatters, add format checking to CI 2022-05-29 21:11:49 -04:00
link2xt b7d2828f60 Trim last newline in the chat encryption info
Android seems to display it, making the message box larger.
2022-05-21 17:03:48 +00:00
link2xt 8168bcece5 Improve Chat.get_encryption_info() format
Group contacts by peerstate and make it easier
to find contacts that prevent encryption by sorting them
to the top of the list.
2022-05-14 14:01:46 +02:00
holger krekel cffa101419 remove usage of py in favor of pathlib 2022-05-09 21:22:19 +02:00
holger krekel c0e4e12138 Introduce caching of configured live accounts in each test process 2022-05-09 21:22:19 +02:00
holger krekel c8bfa98b6b actually enable online account caching. previously it was creating (>100) online test accounts 2022-05-05 16:18:59 +02:00
holger krekel 32a9db6922 fix flaky test to not rely on timing 2022-05-04 13:29:08 +02:00
holger krekel 77498c17a5 reorder tests to provide a complex/offline/online distinction, also speeding up distributed test runs. 2022-05-04 13:17:08 +02:00
holger krekel 54c07f89f2 also guard the ac_process_ffi_event calling 2022-05-04 12:08:47 +02:00