mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-25 04:36:46 +00:00
Rename files
This commit is contained in:
25
ts/util/canAddNewMembers.preload.ts
Normal file
25
ts/util/canAddNewMembers.preload.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright 2023 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { ConversationAttributesType } from '../model-types.d.ts';
|
||||
import { SignalService as Proto } from '../protobuf/index.std.js';
|
||||
import { isGroupV2 } from './whatTypeOfConversation.dom.js';
|
||||
import { areWeAdmin } from './areWeAdmin.preload.js';
|
||||
|
||||
export function canAddNewMembers(
|
||||
conversationAttrs: ConversationAttributesType
|
||||
): boolean {
|
||||
if (!isGroupV2(conversationAttrs)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (conversationAttrs.left) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (
|
||||
areWeAdmin(conversationAttrs) ||
|
||||
conversationAttrs.accessControl?.members ===
|
||||
Proto.AccessControl.AccessRequired.MEMBER
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user