mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: do not call REMOVE op for mutations
This commit is contained in:
@@ -436,7 +436,7 @@ export const chatModificationToAppPatch = (
|
|||||||
index: ['mute', jid],
|
index: ['mute', jid],
|
||||||
type: 'regular_high',
|
type: 'regular_high',
|
||||||
apiVersion: 2,
|
apiVersion: 2,
|
||||||
operation: mod.mute ? OP.SET : OP.REMOVE
|
operation: OP.SET
|
||||||
}
|
}
|
||||||
} else if('archive' in mod) {
|
} else if('archive' in mod) {
|
||||||
patch = {
|
patch = {
|
||||||
@@ -449,7 +449,7 @@ export const chatModificationToAppPatch = (
|
|||||||
index: ['archive', jid],
|
index: ['archive', jid],
|
||||||
type: 'regular_low',
|
type: 'regular_low',
|
||||||
apiVersion: 3,
|
apiVersion: 3,
|
||||||
operation: mod.archive ? OP.SET : OP.REMOVE
|
operation: OP.SET
|
||||||
}
|
}
|
||||||
} else if('markRead' in mod) {
|
} else if('markRead' in mod) {
|
||||||
patch = {
|
patch = {
|
||||||
@@ -462,7 +462,7 @@ export const chatModificationToAppPatch = (
|
|||||||
index: ['markChatAsRead', jid],
|
index: ['markChatAsRead', jid],
|
||||||
type: 'regular_low',
|
type: 'regular_low',
|
||||||
apiVersion: 3,
|
apiVersion: 3,
|
||||||
operation: !mod.markRead ? OP.SET : OP.REMOVE
|
operation: OP.SET
|
||||||
}
|
}
|
||||||
} else if('clear' in mod) {
|
} else if('clear' in mod) {
|
||||||
if(mod.clear === 'all') {
|
if(mod.clear === 'all') {
|
||||||
@@ -491,7 +491,7 @@ export const chatModificationToAppPatch = (
|
|||||||
index: ['pin_v1', '919646328797@s.whatsapp.net'],
|
index: ['pin_v1', '919646328797@s.whatsapp.net'],
|
||||||
type: 'regular_low',
|
type: 'regular_low',
|
||||||
apiVersion: 5,
|
apiVersion: 5,
|
||||||
operation: mod.pin ? OP.SET : OP.REMOVE
|
operation: OP.SET
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Boom('not supported')
|
throw new Boom('not supported')
|
||||||
|
|||||||
Reference in New Issue
Block a user