mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Feat: Mute unknown calls (privacy) (#872)
* Update Chat.ts * Update chats.ts * export * fix sort
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Boom } from '@hapi/boom'
|
||||
import { proto } from '../../WAProto'
|
||||
import { PROCESSABLE_HISTORY_TYPES } from '../Defaults'
|
||||
import { ALL_WA_PATCH_NAMES, ChatModification, ChatMutation, LTHashState, MessageUpsertType, PresenceData, SocketConfig, WABusinessHoursConfig, WABusinessProfile, WAMediaUpload, WAMessage, WAPatchCreate, WAPatchName, WAPresence, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types'
|
||||
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 { chatModificationToAppPatch, ChatMutationMap, decodePatches, decodeSyncdSnapshot, encodeSyncdPatch, extractSyncdPatches, generateProfilePicture, getHistoryMsg, newLTHashState, processSyncAction } from '../Utils'
|
||||
import { makeMutex } from '../Utils/make-mutex'
|
||||
import processMessage from '../Utils/process-message'
|
||||
@@ -83,6 +83,10 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
||||
})
|
||||
}
|
||||
|
||||
const updateCallPrivacy = async(value: WAPrivacyCallValue) => {
|
||||
await privacyQuery('calladd', value)
|
||||
}
|
||||
|
||||
const updateLastSeenPrivacy = async(value: WAPrivacyValue) => {
|
||||
await privacyQuery('last', value)
|
||||
}
|
||||
@@ -976,6 +980,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
||||
updateProfileStatus,
|
||||
updateProfileName,
|
||||
updateBlockStatus,
|
||||
updateCallPrivacy,
|
||||
updateLastSeenPrivacy,
|
||||
updateOnlinePrivacy,
|
||||
updateProfilePicturePrivacy,
|
||||
|
||||
Reference in New Issue
Block a user