fix(api): exclude referenced_message from forwards (#65)
This commit is contained in:
parent
5907b8fbc9
commit
7196ab24fe
@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type {ChannelID, MessageID, UserID} from '~/BrandedTypes';
|
import type {ChannelID, MessageID, UserID} from '~/BrandedTypes';
|
||||||
|
import {MessageReferenceTypes} from '~/Constants';
|
||||||
import {makeAttachmentCdnUrl} from '~/channel/services/message/MessageHelpers';
|
import {makeAttachmentCdnUrl} from '~/channel/services/message/MessageHelpers';
|
||||||
import type {IMediaService} from '~/infrastructure/IMediaService';
|
import type {IMediaService} from '~/infrastructure/IMediaService';
|
||||||
import type {UserCacheService} from '~/infrastructure/UserCacheService';
|
import type {UserCacheService} from '~/infrastructure/UserCacheService';
|
||||||
@ -338,7 +339,7 @@ export async function mapMessageToResponse({
|
|||||||
|
|
||||||
if (message.reference) {
|
if (message.reference) {
|
||||||
response.message_reference = mapMessageReference({reference: 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);
|
const referencedMessage = await getReferencedMessage(message.reference.channelId, message.reference.messageId);
|
||||||
if (referencedMessage) {
|
if (referencedMessage) {
|
||||||
response.referenced_message = await mapMessageToResponse({
|
response.referenced_message = await mapMessageToResponse({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user