From 85a58fbc10caa92e726044336a7e6ff3f562fc62 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Thu, 12 May 2022 18:58:02 +0530 Subject: [PATCH] fix: normalize participants API --- src/LegacySocket/groups.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/LegacySocket/groups.ts b/src/LegacySocket/groups.ts index d8a012c..b6bbc9b 100644 --- a/src/LegacySocket/groups.ts +++ b/src/LegacySocket/groups.ts @@ -216,7 +216,9 @@ const makeGroupsSocket = (config: LegacySocketConfig) => { const result: GroupModificationResponse = await groupQuery(action, id, null, participants) const jids = Object.keys(result.participants || {}) ev.emit('group-participants.update', { id, participants: jids, action }) - return jids + return Object.keys(result.participants || {}).map( + jid => ({ jid, status: result.participants?.[jid] }) + ) }, /** Query broadcast list info */ getBroadcastListInfo: async(jid: string) => {