Blur avatars of unapproved conversations
This commit is contained in:
parent
bbd7fd3854
commit
05703c2719
28 changed files with 474 additions and 124 deletions
28
ts/util/shouldBlurAvatar.ts
Normal file
28
ts/util/shouldBlurAvatar.ts
Normal file
|
@ -0,0 +1,28 @@
|
|||
// 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
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue