feat: Set in group settings memberAddMode and joinApprovalMode (#534)

* feat: Set in group settings memberAddMode and joinApprovalMode

* fix lint

* fix lint

* fix conflict

---------

Co-authored-by: Bob <115008575+FortisEtMagnus@users.noreply.github.com>
Co-authored-by: Bob <115008575+bobpetrov@users.noreply.github.com>
Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
This commit is contained in:
Bob
2024-01-19 12:59:42 -03:00
committed by GitHub
parent a60cdfb053
commit 408c0070ba

View File

@@ -301,6 +301,12 @@ export const makeGroupsSocket = (config: SocketConfig) => {
groupSettingUpdate: async(jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked') => {
await groupQuery(jid, 'set', [ { tag: setting, attrs: { } } ])
},
groupMemberAddMode: async(jid: string, mode: 'admin_add' | 'all_member_add') => {
await groupQuery(jid, 'set', [ { tag: 'member_add_mode', attrs: { }, content: mode } ])
},
groupJoinApprovalMode: async(jid: string, mode: 'on' | 'off') => {
await groupQuery(jid, 'set', [ { tag: 'membership_approval_mode', attrs: { }, content: [ { tag: 'group_join', attrs: { state: mode } } ] } ])
},
groupFetchAllParticipating
}
}