mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat(feature/group-invite-v4): initial/final commit (#958)
This commit is contained in:
@@ -191,7 +191,7 @@ export const makeGroupsSocket = (config: SocketConfig) => {
|
||||
]
|
||||
)
|
||||
const node = getBinaryNodeChild(result, action)
|
||||
const participantsAffected = getBinaryNodeChildren(node!, 'participant')
|
||||
const participantsAffected = getBinaryNodeChildren(node, 'participant')
|
||||
return participantsAffected.map(p => {
|
||||
return { status: p.attrs.error || '200', jid: p.attrs.jid, content: p }
|
||||
})
|
||||
@@ -232,6 +232,18 @@ export const makeGroupsSocket = (config: SocketConfig) => {
|
||||
const result = getBinaryNodeChild(results, 'group')
|
||||
return result?.attrs.jid
|
||||
},
|
||||
|
||||
/**
|
||||
* revoke a v4 invite for someone
|
||||
* @param groupJid group jid
|
||||
* @param invitedJid jid of person you invited
|
||||
* @returns true if successful
|
||||
*/
|
||||
groupRevokeInviteV4: async(groupJid: string, invitedJid: string) => {
|
||||
const result = await groupQuery(groupJid, 'set', [{ tag: 'revoke', attrs: {}, content: [{ tag: 'participant', attrs: { jid: invitedJid } }] }])
|
||||
return !!result
|
||||
},
|
||||
|
||||
/**
|
||||
* accept a GroupInviteMessage
|
||||
* @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
|
||||
|
||||
Reference in New Issue
Block a user