From 7196ab24fe779dfd922466e34f597c64ec94ddfe Mon Sep 17 00:00:00 2001 From: Hampus Date: Tue, 6 Jan 2026 18:00:10 +0100 Subject: [PATCH] fix(api): exclude referenced_message from forwards (#65) --- fluxer_api/src/channel/MessageMappers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fluxer_api/src/channel/MessageMappers.ts b/fluxer_api/src/channel/MessageMappers.ts index 8f594337..fd0788d4 100644 --- a/fluxer_api/src/channel/MessageMappers.ts +++ b/fluxer_api/src/channel/MessageMappers.ts @@ -18,6 +18,7 @@ */ import type {ChannelID, MessageID, UserID} from '~/BrandedTypes'; +import {MessageReferenceTypes} from '~/Constants'; import {makeAttachmentCdnUrl} from '~/channel/services/message/MessageHelpers'; import type {IMediaService} from '~/infrastructure/IMediaService'; import type {UserCacheService} from '~/infrastructure/UserCacheService'; @@ -338,7 +339,7 @@ export async function mapMessageToResponse({ if (message.reference) { response.message_reference = mapMessageReference({reference: message.reference}); - if (withMessageReference && getReferencedMessage) { + if (withMessageReference && getReferencedMessage && message.reference.type === MessageReferenceTypes.DEFAULT) { const referencedMessage = await getReferencedMessage(message.reference.channelId, message.reference.messageId); if (referencedMessage) { response.referenced_message = await mapMessageToResponse({