chore: update group invite docs

This commit is contained in:
Adhiraj Singh
2022-06-13 19:55:37 +05:30
parent 32fadda86a
commit 07f0ff86e8

View File

@@ -137,11 +137,20 @@ export const makeGroupsSocket = (config: SocketConfig) => {
const result = getBinaryNodeChild(results, 'group')
return result.attrs.jid
},
groupAcceptInviteV4: async(jid: string, inviteMessage: proto.IGroupInviteMessage) => {
const results = await groupQuery(inviteMessage.groupJid, 'set', [{ tag: 'accept', attrs: {
code: inviteMessage.inviteCode,
expiration: inviteMessage.inviteExpiration.toString(),
admin: jid } }])
/**
* accept a GroupInviteMessage
* @param senderJid jid of the person that sent the message
* @param inviteMessage the message to accept
*/
groupAcceptInviteV4: async(senderJid: string, inviteMessage: proto.IGroupInviteMessage) => {
const results = await groupQuery(inviteMessage.groupJid, 'set', [{
tag: 'accept',
attrs: {
code: inviteMessage.inviteCode,
expiration: inviteMessage.inviteExpiration.toString(),
admin: senderJid
}
}])
return results.attrs.from
},
groupToggleEphemeral: async(jid: string, ephemeralExpiration: number) => {