mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
fix(api): reject alt text edits on forwarded messages (#1739)
This commit is contained in:
1 parent
8836565c32
commit
a81b1abec7
2 files changed
+3
-14
No files matched your search
@@ -570,6 +570,7 @@ export function useMediaMenuData(props: MediaMenuDataProps, options: MediaMenuDa
|
||||
const canManageMessages = Permission.can(Permissions.MANAGE_MESSAGES, {channelId: message.channelId});
|
||||
const canEditAltText = useMemo(() => {
|
||||
if (!attachmentId) return false;
|
||||
if (snapshotIndex !== undefined || message.messageSnapshots) return false;
|
||||
const attachmentSource = snapshotAttachments ?? message.attachments;
|
||||
const attachment = attachmentSource.find((att) => att.id === attachmentId);
|
||||
const mimeType = attachment?.content_type?.toLowerCase() ?? '';
|
||||
@@ -577,7 +578,7 @@ export function useMediaMenuData(props: MediaMenuDataProps, options: MediaMenuDa
|
||||
if (!canEditMedia) return false;
|
||||
const isMessageAuthor = currentUserId === message.author?.id;
|
||||
return isMessageAuthor || canManageMessages;
|
||||
}, [attachmentId, canManageMessages, currentUserId, message, snapshotAttachments]);
|
||||
}, [attachmentId, canManageMessages, currentUserId, message, snapshotAttachments, snapshotIndex]);
|
||||
const handleAddToFavorites = useCallback(() => {
|
||||
ModalCommands.pushAfterBottomSheetClose(
|
||||
onClose,
|
||||
|
||||
Reference in new issue
Block a user