Skip to content

Forwarded sticker's quote points to last message of target chat #8053

@WofWca

Description

@WofWca
  • Operating System (Linux/Mac/Windows/iOS/Android):
  • Core Version: 2.47.0
  • Client Version: latest main

Expected behavior

Something sane.

Actual behavior

The forwarded message has a quote whose author is the author of the prior last message in chat 2. However, the text of the quote is the text of the message from step 1.

Steps to reproduce the problem

  1. Send a message to chat 1.
  2. Reply with a sticker to that message (only possible on Android as of writing).
  3. Forward the reply to chat 2.

Screenshots

Image

Logs

Related:

Some relevant code:

core/src/message.rs

Lines 1267 to 1273 in 2637c3b

/// Returns quoted message, if any.
pub async fn quoted_message(&self, context: &Context) -> Result<Option<Message>> {
if self.param.get(Param::Quote).is_some() && !self.is_forwarded() {
return self.parent(context).await;
}
Ok(None)
}

core/src/chat.rs

Lines 4497 to 4504 in 2637c3b

if msg.get_viewtype() != Viewtype::Sticker {
let forwarded_msg_id = match ctx_src.blobdir == ctx_dst.blobdir {
true => src_msg_id,
false => MsgId::new_unset(),
};
msg.param
.set_int(Param::Forwarded, forwarded_msg_id.to_u32() as i32);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions