From 49d7d9ff628a7904c3c45083c0a6951bcda375f0 Mon Sep 17 00:00:00 2001 From: RoyceDa Date: Tue, 24 Feb 2026 19:15:58 +0200 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D1=83=D1=81=D1=82?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B8=20=D0=B0=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D0=B0=D1=80=D0=BA=D0=B8=20=D1=83=20=D0=B3=D1=80=D1=83=D0=BF?= =?UTF-8?q?=D0=BF=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/providers/AttachmentProvider/useAttachment.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/providers/AttachmentProvider/useAttachment.ts b/app/providers/AttachmentProvider/useAttachment.ts index d5d88d2..8190277 100644 --- a/app/providers/AttachmentProvider/useAttachment.ts +++ b/app/providers/AttachmentProvider/useAttachment.ts @@ -15,6 +15,7 @@ import { AVATAR_PASSWORD_TO_ENCODE } from "@/app/constants"; import { useDialog } from "../DialogProvider/useDialog"; import { useCore } from "@/app/hooks/useCore"; import { MessageProps } from "@/app/components/Messages/Message"; +import { useGroups } from "../DialogProvider/useGroups"; export enum DownloadStatus { DOWNLOADED, @@ -39,6 +40,8 @@ export function useAttachment(attachment: Attachment, parentMessage: MessageProp const {info} = useConsoleLogger('useAttachment'); const {updateAttachmentsInMessagesByAttachmentId} = useDialog(); const {getDownloadsPath} = useCore(); + const {hasGroup} = useGroups(); + const {dialog} = useDialog(); const saveAvatar = useSaveAvatar(); @@ -186,7 +189,11 @@ export function useAttachment(attachment: Attachment, parentMessage: MessageProp /** * Устанавливаем аватарку тому, кто ее прислал. */ - saveAvatar(parentMessage.from, avatarPath, decrypted); + let avatarSetTo = parentMessage.from; + if(hasGroup(dialog)){ + avatarSetTo = dialog; + } + saveAvatar(avatarSetTo, avatarPath, decrypted); return; } /**