29 lines
615 B
TypeScript
29 lines
615 B
TypeScript
![]() |
// Copyright 2021 Signal Messenger, LLC
|
||
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||
|
|
||
|
import { ConversationType } from '../state/ducks/conversations';
|
||
|
|
||
|
export const shouldBlurAvatar = ({
|
||
|
acceptedMessageRequest,
|
||
|
avatarPath,
|
||
|
isMe,
|
||
|
sharedGroupNames = [],
|
||
|
unblurredAvatarPath,
|
||
|
}: Readonly<
|
||
|
Pick<
|
||
|
ConversationType,
|
||
|
| 'acceptedMessageRequest'
|
||
|
| 'avatarPath'
|
||
|
| 'isMe'
|
||
|
| 'sharedGroupNames'
|
||
|
| 'unblurredAvatarPath'
|
||
|
>
|
||
|
>): boolean =>
|
||
|
Boolean(
|
||
|
!isMe &&
|
||
|
!acceptedMessageRequest &&
|
||
|
!sharedGroupNames.length &&
|
||
|
avatarPath &&
|
||
|
avatarPath !== unblurredAvatarPath
|
||
|
);
|