A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
fix(api): give the system message author the instance's name
Hampus2a77c12b6730
diff --git a/fluxer_api/src/api/channel/services/message/MessageResponseDataService.ts b/fluxer_api/src/api/channel/services/message/MessageResponseDataService.tsindex 7130395ce..5d6f78e7f 100644--- a/fluxer_api/src/api/channel/services/message/MessageResponseDataService.ts+++ b/fluxer_api/src/api/channel/services/message/MessageResponseDataService.ts@@ -6,6 +6,7 @@ import {createUserID} from '@app/api/BrandedTypes';import {Config} from '@app/api/Config';import type {ChannelRepository} from '@app/api/channel/ChannelRepository';import {requestSvcJson} from '@app/api/infrastructure/SvcErrorReply';+import {getInstanceProductName} from '@app/api/instance/ProductName';import {Logger} from '@app/api/Logger';import type {Channel} from '@app/api/models/Channel';import type {Message} from '@app/api/models/Message';@@ -96,6 +97,7 @@ export class MessageResponseDataService {media_proxy_secret_key: Config.mediaProxy.secretKey,attachment_url_secret_base64: Config.mediaProxy.attachmentUrls.secretsBase64[0],attachment_decay: await attachmentDecayEnabled(),+ instance_name: getInstanceProductName(),};}constructor(private readonly connectionManager: INatsConnectionManager) {}@@ -211,7 +213,6 @@ export class MessageResponseDataService {userId: UserID;messages: Array<Message>;access: MessageResponseAccessContext;- includeReactions?: boolean;}): Promise<Array<MessageResponse>> {if (params.messages.length === 0) return [];const responses: Array<MessageResponse> = [];@@ -293,7 +294,7 @@ function messageResponseViewerId(message: Message, currentUserId?: UserID): Userreturn currentUserId ?? message.authorId ?? createUserID(0n);}-export function messageResponseAccessForChannel(channel: Pick<Channel, 'guildId'>): MessageResponseAccessContext {+function messageResponseAccessForChannel(channel: Pick<Channel, 'guildId'>): MessageResponseAccessContext {return messageResponseAccessForGuild(channel.guildId);}