Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix forwarding messages from encrypted to unencrypted chat without creating a new message object #5125

Merged
merged 6 commits into from
Jan 17, 2024

Conversation

missytake
Copy link
Contributor

@missytake missytake commented Dec 21, 2023

fixes #5123

the test passes actually, I think it's not the same problem the teams-bot has. seems the test fails for the right reasons now :)

@missytake missytake force-pushed the missytake/test-5123 branch 3 times, most recently from 4f8b801 to d4a9e93 Compare December 22, 2023 00:45
@iequidoo
Copy link
Collaborator

iequidoo commented Jan 13, 2024

IDK how, but it works in my Desktop. I can forward encrypted messages to unencrypted chats so that they are sent as unencrypted. Version 1.42.2 (git: v1.33.0-555-g9da03dd2).

EDIT: Also it works on Android. And even forwarding from verified 1:1-s.

@missytake
Copy link
Contributor Author

IDK how, but it works in my Desktop. I can forward encrypted messages to unencrypted chats so that they are sent as unencrypted. Version 1.42.2 (git: v1.33.0-555-g9da03dd2).

EDIT: Also it works on Android. And even forwarding from verified 1:1-s.

Yes, they are creating a new message object I think. That it does not work like this in the python bindings is a footgun, and it also breaks the teams-bot use case.

Copy link
Collaborator

@iequidoo iequidoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the bug itself should be fixed in this PR also, then we can merge it. I can try on my own

python/src/deltachat/testplugin.py Outdated Show resolved Hide resolved
missytake and others added 4 commits January 16, 2024 14:37
…ent API

Currently `Chat.send_msg()` modifies the source message and returns another message object
equivalent to the source one. That's how it works in the core and thus in Python bindings too.
…nt message

This allows to send existing messages (incoming and outgoing) taken from encrypted chats, to
unencrypted ones. `Param::ForcePlaintext` is removed as well -- if a message can be sent encrypted
this time, nothing bad with this.
@missytake
Copy link
Contributor Author

Nice, it fixes the bug in teams-bot as well! I added two assert statements to the test fixture, which serve to document which messages get awaited.

Can be merged :) and I'd also be happy about a core release so I can fix the teams-bots out there.

@missytake missytake changed the title test: add python test for message forwarding from encrypted to unencrypted chat fix forwarding messages from encrypted to unencrypted chat without creating a new message object Jan 16, 2024
@iequidoo
Copy link
Collaborator

I'd suggest to wait a bit for @link2xt to check the core change as the issue creator

python/tests/test_1_online.py Outdated Show resolved Hide resolved
@missytake
Copy link
Contributor Author

CI passes :) so should it be simply rebased, or also squashed?

@link2xt
Copy link
Collaborator

link2xt commented Jan 17, 2024

CI passes :) so should it be simply rebased, or also squashed?

Whatever you prefer, but in this case better not squash as it has nice commit messages that end up in the changelog.

@missytake missytake merged commit bbc6feb into main Jan 17, 2024
38 checks passed
@missytake missytake deleted the missytake/test-5123 branch January 17, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Python tests for message forwarding from encrypted to unencrypted chat
3 participants