Skip to content

Commit

Permalink
fix: remove 'none' from updateGroupsAddPrivacy (#966)
Browse files Browse the repository at this point in the history
* fix: remove 'none' from updateGroupsAddPrivacy

* fix(fix/remove-none-groupadd): linting

---------

Co-authored-by: Rajeh Taher <[email protected]>
  • Loading branch information
arthursimas1 and purpshell authored Aug 14, 2024
1 parent c32ea03 commit ffafc16
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ Of course, replace ``` xyz ``` with an actual ID.
```
- To update the Groups Add privacy
``` ts
const value = 'all' // 'contacts' | 'contact_blacklist' | 'none'
const value = 'all' // 'contacts' | 'contact_blacklist'
await sock.updateGroupsAddPrivacy(value)
```
- To update the Default Disappearing Mode
Expand Down
4 changes: 2 additions & 2 deletions src/Socket/chats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Boom } from '@hapi/boom'
import NodeCache from 'node-cache'
import { proto } from '../../WAProto'
import { DEFAULT_CACHE_TTLS, PROCESSABLE_HISTORY_TYPES } from '../Defaults'
import { ALL_WA_PATCH_NAMES, ChatModification, ChatMutation, LTHashState, MessageUpsertType, PresenceData, SocketConfig, WABusinessHoursConfig, WABusinessProfile, WAMediaUpload, WAMessage, WAPatchCreate, WAPatchName, WAPresence, WAPrivacyCallValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types'
import { ALL_WA_PATCH_NAMES, ChatModification, ChatMutation, LTHashState, MessageUpsertType, PresenceData, SocketConfig, WABusinessHoursConfig, WABusinessProfile, WAMediaUpload, WAMessage, WAPatchCreate, WAPatchName, WAPresence, WAPrivacyCallValue, WAPrivacyGroupAddValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types'
import { chatModificationToAppPatch, ChatMutationMap, decodePatches, decodeSyncdSnapshot, encodeSyncdPatch, extractSyncdPatches, generateProfilePicture, getHistoryMsg, newLTHashState, processSyncAction } from '../Utils'
import { makeMutex } from '../Utils/make-mutex'
import processMessage from '../Utils/process-message'
Expand Down Expand Up @@ -117,7 +117,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
await privacyQuery('readreceipts', value)
}

const updateGroupsAddPrivacy = async(value: WAPrivacyValue) => {
const updateGroupsAddPrivacy = async(value: WAPrivacyGroupAddValue) => {
await privacyQuery('groupadd', value)
}

Expand Down
2 changes: 2 additions & 0 deletions src/Types/Chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export type WAPrivacyValue = 'all' | 'contacts' | 'contact_blacklist' | 'none'

export type WAPrivacyOnlineValue = 'all' | 'match_last_seen'

export type WAPrivacyGroupAddValue = 'all' | 'contacts' | 'contact_blacklist'

export type WAReadReceiptsValue = 'all' | 'none'

export type WAPrivacyCallValue = 'all' | 'known'
Expand Down

0 comments on commit ffafc16

Please sign in to comment.