Skip to content

Fix chat assignment when forwarding#2843

Merged
link2xt merged 6 commits intomasterfrom
forward-in_reply_to
Nov 27, 2021
Merged

Fix chat assignment when forwarding#2843
link2xt merged 6 commits intomasterfrom
forward-in_reply_to

Conversation

@link2xt
Copy link
Copy Markdown
Collaborator

@link2xt link2xt commented Nov 26, 2021

6 commits, even commits are fixes, odd commits are tests. Reverting any fix breaks the corresponding test.

Merge with --no-ff to make testing easier.

Fixes #2839

@link2xt link2xt requested review from Hocuri and r10s November 26, 2021 22:14
@link2xt link2xt force-pushed the forward-in_reply_to branch from 2a55ef2 to c29149e Compare November 26, 2021 22:27
This function is used to lookup the chat by `References` and
`In-Reply-To` header, so it does not make sense to return trashed
message when there is another non-trashed message in one of these
headers with a real chat ID.
For forwarded messages, parent message is not a quoted message.
Copy link
Copy Markdown
Collaborator

@Hocuri Hocuri left a comment

Choose a reason for hiding this comment

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

🎉

@link2xt link2xt merged commit 6ce97bd into master Nov 27, 2021
@link2xt link2xt deleted the forward-in_reply_to branch November 27, 2021 13:35
WofWca added a commit that referenced this pull request Mar 28, 2026
This change might be controversal.
According to the `test_forward_quote` test
(introduced in 6b3b33d,
#2843),
this behavior is intentional.
That MR only removed the message ID assignment
but did _not_ remove the text altogether.

On the other hand other messengers, including Telegram and WhatsApp,
don't do this (they don't forward quotes together with messages).
I argue that doing this is not expected by most users,
and is bad for privacy.
Forwarding a message should only forward that message,
and not carry any more information.

How I came to this: I was working on
#8053
trying to undestand why the quoted message ID defaults
to the last message of the target chat.
And, thanks to 3f27be9,
I questioned: "Why are we forwarding quotes in the first place?".
So this also closes #8053.

Note that this commit does not alter `quoted_message()`.
That's for displaying old messages,
and for compatibility with senders that do not remove the quote
from forwarded messages.
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.

Forwarded messages break group assignment

2 participants