From e52570bbd7576c6adb40b31a5eee1f5bc120afe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Roberto=20J=C3=BAnior?= <53500803+juniorkrz@users.noreply.github.com> Date: Sun, 28 Apr 2024 08:02:49 -0300 Subject: [PATCH] add linkedParent in groupMetadata (#734) * Update GroupMetadata.ts * Update groups.ts --- 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 b7814a2..2c7d949 100644 --- a/src/Socket/groups.ts +++ b/src/Socket/groups.ts @@ -335,6 +335,7 @@ export const extractGroupMetadata = (result: BinaryNode) => { owner: group.attrs.creator ? jidNormalizedUser(group.attrs.creator) : undefined, desc, descId, + linkedParent: getBinaryNodeChild(group, 'linked_parent')?.attrs.jid || undefined, restrict: !!getBinaryNodeChild(group, 'locked'), announce: !!getBinaryNodeChild(group, 'announcement'), isCommunity: !!getBinaryNodeChild(group, 'parent'), diff --git a/src/Types/GroupMetadata.ts b/src/Types/GroupMetadata.ts index 3417300..baa284c 100644 --- a/src/Types/GroupMetadata.ts +++ b/src/Types/GroupMetadata.ts @@ -16,6 +16,8 @@ export interface GroupMetadata { desc?: string descOwner?: string descId?: string + /** if this group is part of a community, it returns the jid of the community to which it belongs */ + linkedParent?: string /** is set when the group only allows admins to change group settings */ restrict?: boolean /** is set when the group only allows admins to write messages */