fix: a reply to an app card shows an empty quote

When someone replied to an app message that holds only a card, the quote above the reply showed the app's name and nothing else after the channel was opened or reloaded. The quote now shows the card's author, title, description, fields and footer, after a reload, inside threads and for replies that arrive while the channel is open.

Fixes #32361
This commit is contained in:
Classic298 2026-10-13 20:08:01 +02:00
parent 5032e834ea
commit 5eaf9bc55f
2 changed files with 15 additions and 0 deletions

View file

@ -117,6 +117,10 @@ class MessageUserSlimResponse(MessageUserResponse):
@field_validator('data', mode='before')
def convert_data_to_bool(cls, v):
# A listed reply validates its quoted message twice, so keep the flag.
if isinstance(v, bool):
return v
# No data or not a dict → False
if not isinstance(v, dict):
return False

View file

@ -156,6 +156,17 @@
loadMessageData();
}
const loadReplyToMessageData = async () => {
const res = await getMessageData(localStorage.token, channel?.id, message.reply_to_message.id);
if (res) {
message.reply_to_message.data = res;
}
};
$: if (message?.reply_to_message?.app_id && message.reply_to_message.data === true) {
loadReplyToMessageData();
}
$: messageOutput = Array.isArray(message?.data?.output) ? message.data.output : [];
$: hasStructuredOutput = buildOutputDisplayItems(messageOutput).length > 0;
</script>