mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
fix(app): honour silent and emoticon settings on forward comments (#2000)
This commit is contained in:
1 parent
9f5a5b16d3
commit
42e45a0e3a
1 file changed
+8
-5
@@ -31,9 +31,10 @@ import {
|
||||
collectMessageModelGuildMemberUserIds,
|
||||
collectWireMessageGuildMemberUserIds,
|
||||
} from '@app/features/messaging/utils/MessageMemberLoadUtils';
|
||||
import type {
|
||||
ApiAttachmentMetadata,
|
||||
ApiMessageEditAttachmentMetadata,
|
||||
import {
|
||||
type ApiAttachmentMetadata,
|
||||
type ApiMessageEditAttachmentMetadata,
|
||||
normalizeMessageContent,
|
||||
} from '@app/features/messaging/utils/MessageRequestUtils';
|
||||
import * as IARCommands from '@app/features/moderation/commands/IARCommands';
|
||||
import * as NavigationCommands from '@app/features/navigation/commands/NavigationCommands';
|
||||
@@ -814,6 +815,7 @@ export async function forward(
|
||||
optionalMessage?: string,
|
||||
): Promise<boolean> {
|
||||
logger.debug(`Forwarding message ${messageReference.message_id} to ${channelIds.length} channels`);
|
||||
const normalizedComment = optionalMessage == null ? null : normalizeMessageContent(optionalMessage);
|
||||
try {
|
||||
for (const channelId of channelIds) {
|
||||
const nonce = SnowflakeUtils.fromTimestamp(Date.now());
|
||||
@@ -835,11 +837,12 @@ export async function forward(
|
||||
return false;
|
||||
}
|
||||
SlowmodeCommands.confirmMessageSend(channelId, forwardedMessage.timestamp);
|
||||
if (optionalMessage) {
|
||||
if (normalizedComment != null && normalizedComment.content.length > 0) {
|
||||
const commentNonce = SnowflakeUtils.fromTimestamp(Date.now() + 1);
|
||||
const commentMessage = await send(channelId, {
|
||||
content: optionalMessage,
|
||||
content: normalizedComment.content,
|
||||
nonce: commentNonce,
|
||||
flags: normalizedComment.flags,
|
||||
});
|
||||
if (!commentMessage) {
|
||||
logger.warn(`Forward comment send failed in channel ${channelId}`);
|
||||
|
||||
Reference in new issue
Block a user