From c41be3ac4fd90bf1ce748b7905e74600cef8a1d1 Mon Sep 17 00:00:00 2001 From: Bob <115008575+bobslavtriev@users.noreply.github.com> Date: Fri, 19 Jan 2024 13:31:35 -0300 Subject: [PATCH] feat: If need approval to join the group in groupMetadata (#533) * If need approval to join the group * If need approval to join the group * Update groups.ts * Update groups.ts * fix lint * Update groups.ts * Update groups.ts --------- Co-authored-by: Bob <115008575+FortisEtMagnus@users.noreply.github.com> Co-authored-by: Bob <115008575+bobpetrov@users.noreply.github.com> --- src/Socket/groups.ts | 1 + src/Types/GroupMetadata.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/Socket/groups.ts b/src/Socket/groups.ts index 030e70d..b7814a2 100644 --- a/src/Socket/groups.ts +++ b/src/Socket/groups.ts @@ -339,6 +339,7 @@ export const extractGroupMetadata = (result: BinaryNode) => { announce: !!getBinaryNodeChild(group, 'announcement'), isCommunity: !!getBinaryNodeChild(group, 'parent'), isCommunityAnnounce: !!getBinaryNodeChild(group, 'default_sub_group'), + joinApprovalMode: !!getBinaryNodeChild(group, 'membership_approval_mode'), memberAddMode, participants: getBinaryNodeChildren(group, 'participant').map( ({ attrs }) => { diff --git a/src/Types/GroupMetadata.ts b/src/Types/GroupMetadata.ts index d5b870c..db89688 100644 --- a/src/Types/GroupMetadata.ts +++ b/src/Types/GroupMetadata.ts @@ -22,6 +22,8 @@ export interface GroupMetadata { announce?: boolean /** is set when the group also allows members to add participants */ memberAddMode?: boolean + /** Request approval to join the group */ + joinApprovalMode?: boolean /** is this a community */ isCommunity?: boolean /** is this the announce of a community */