fix: normalize participants API

This commit is contained in:
Adhiraj Singh
2022-05-12 18:58:02 +05:30
parent 46f309929b
commit 85a58fbc10

View File

@@ -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) => {