Commit Graph

653 Commits

Author SHA1 Message Date
iequidoo 36991b5c8a Add Python API to send reactions (#3762) 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
Hocuri ffd57772e9 Add DC_EVENT_INCOMING_MSG_BUNCH event (#3643)
* Add DC_EVENT_INCOMING_MSG event

* Fix lots of compile errors

* Docs

* Changelog

* Fix python tests

Adding DC_EVENT_INCOMING_MSG_BUNCH made the python tests fail because they use `get_matching("DC_EVENT_INCOMING_MSG")`, which also matches DC_EVENT_INCOMING_MSG_BUNCH, so the tests got confused.

This fixes `get_matching()` to only match whole event names.

* Also fix test_ac_setup_message_twice()

The built regex was ^EVENT_NAME1|EVENT_NAME2$, which becomes parsed as
"^EVENT_NAME1" OR "EVENT_NAME2$". Introduce a group (parentheses) to fix
this.

* desktop will use DC_EVENT_INCOMING_MSG_BUNCH,
so I would not call it experimental anymore

* add generated node constants

* msg_ids in the event as Vec<u32>
number[] in js land

this is way more convinient than a json encoded string.

* Apply suggestions from code review

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

Co-authored-by: Simon Laux <mobile.info@simonlaux.de>
Co-authored-by: Simon Laux <Simon-Laux@users.noreply.github.com>
Co-authored-by: bjoern <r10s@b44t.com>
2022-11-06 17:17:48 +00:00
link2xt 97192a8055 Set RUST_MIN_STACK for Python tests 2022-11-04 12:32:22 +00: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
link2xt 40dc182295 python: move get_dc_event_name() to events 2022-09-10 21:22:38 +00:00
link2xt 977a8cf33f python: remove unused setup.cfg 2022-08-22 00:11:01 +00:00
link2xt 839021f9eb python: enable certificate checks in cloned accounts 2022-08-15 14:40:33 +00: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 9707f13a42 deprecated check whether account can be reconfigured 2022-08-15 01:07:42 +02:00
missytake 82d36e604c don't raise an error if addr changes 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 95a9f1e2f8 Build with jsonrpc in install_python_bindings.py
Python bindings expect all functions defined in deltachat.h
to be available, even if there is no high-level interface.

scripts/run-python-test.sh doesn't work without this.
2022-08-06 21:00:55 +00:00
missytake 64515786be apparently lint likes long lines more than me 2022-07-25 21:56:14 +02:00
missytake 52a8ec48b7 move account initialization to separate function 2022-07-25 21:56:14 +02:00
link2xt d72cf3fb43 mimeparser: set is_system_message for "group image changed" messages 2022-07-24 13:05:14 +00:00
link2xt d09be1f7e3 python: don't build wheels for dependencies 2022-07-14 14:39:39 +02:00
link2xt ed5fc820c2 python: move most of setup.py to pyproject.toml 2022-07-14 14:39:39 +02:00
link2xt 248d9600c5 python: remove fail_test.py
It was added in 11fa60d690
2022-07-12 00:46:28 +00:00
link2xt 88402288f9 Update Python bindings README
Wheels are now published to PyPI, recommend it instead of devpi. We
build the wheels only for releases anyway.

Suggest using tox instead of listing all the pytest dependencies to
avoid keeping them up to date in the readme.

We no longer publish `docker/coredeps` images, they cannot be
pulled from a container registry anymore.

Troubleshooting section is outdated, because vsyscall emulation is
only needed for manylinux2010 images, not manylinux2014 or
musllinux_1_1 images.

Mention Podman as an alternative to Docker.

Link to https://py.delta.chat/ instead of only examples.

Remove note about wheels for Mac and Windows. Nobody requests them
anyway.
2022-07-09 19:50:44 +00:00
link2xt d9003f344e tox.ini: do not pass through unused TRAVIS environment variable 2022-07-09 13:17:36 +00: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 dc29ede6e3 restore pytest-rerunfailures 2022-06-20 11:52:59 +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
link2xt bc604d4c24 Do not rerun python and node tests, exit on failure 2022-06-18 01:38:31 +00:00
link2xt 8a4e07c83e Replace Freenode references with Libera Chat 2022-06-12 19:09:29 +00:00
link2xt e993b37f1e python: autoformat setup.py and install_python_bindings.py 2022-06-11 15:35:30 +00:00
adbenitez a96a4362cd add missing Message API 2022-06-10 07:57:17 -04:00
Asiel Díaz Benítez 1fb6d1b59d Merge pull request #3412 from deltachat/adb/allow-comparing-with-none
avoid exceptions when messages/contacts/chats are compared with None
2022-06-10 03:21:41 -04:00
adbenitez f94d7d9ea5 add tests 2022-06-10 02:30:37 -04:00
adbenitez 521d14a6e0 avoid exceptions when messages/contacts/chats are compared with None 2022-06-09 05:00:02 -04:00
adbenitez e334b781fb move isort configuration to pyproject.toml instead of passing it in command line usage in tox.ini, this allows isort usage with editors to pick the right configuration without manually tweaking it in the editors 2022-06-09 04:24:28 -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 d3e6cc5acb set black.line-length to 120 2022-05-31 23:02:51 -04:00
adbenitez 723d1828ec configure flake8 to be compatible with black 2022-05-31 05:29:35 -04:00
adbenitez 16e0f0e986 apply isort and black formatters, add format checking to CI 2022-05-29 21:11:49 -04:00
link2xt 1d522edb01 python: fix Chat.is_group() documentation
False is returned not only for 1:1 chat, but also in
other cases, such as mailing lists.
2022-05-23 11:56:56 +02: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 1d7d201b5b remove a log line and a return 2022-05-09 21:22:19 +02:00