2021-04-30 19:40:25 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { ConversationType } from '../state/ducks/conversations';
|
2021-04-30 19:40:25 +00:00
|
|
|
|
|
|
|
export const shouldBlurAvatar = ({
|
|
|
|
acceptedMessageRequest,
|
|
|
|
avatarPath,
|
|
|
|
isMe,
|
2021-05-07 22:21:10 +00:00
|
|
|
sharedGroupNames,
|
2021-04-30 19:40:25 +00:00
|
|
|
unblurredAvatarPath,
|
|
|
|
}: Readonly<
|
|
|
|
Pick<
|
|
|
|
ConversationType,
|
|
|
|
| 'acceptedMessageRequest'
|
|
|
|
| 'avatarPath'
|
|
|
|
| 'isMe'
|
|
|
|
| 'sharedGroupNames'
|
|
|
|
| 'unblurredAvatarPath'
|
|
|
|
>
|
|
|
|
>): boolean =>
|
|
|
|
Boolean(
|
|
|
|
!isMe &&
|
|
|
|
!acceptedMessageRequest &&
|
|
|
|
!sharedGroupNames.length &&
|
|
|
|
avatarPath &&
|
|
|
|
avatarPath !== unblurredAvatarPath
|
|
|
|
);
|