feat: add per-jid patching

This does not work in groups
This commit is contained in:
Rajeh Taher
2025-03-10 14:51:13 +02:00
parent 40b8cc5383
commit e1aadc5546
2 changed files with 20 additions and 9 deletions

View File

@@ -23,6 +23,8 @@ export type CacheStore = {
flushAll(): void
}
export type PatchedMessageWithRecipientJID = proto.IMessage & {recipientJid?: string}
export type SocketConfig = {
/** the WS url to connect to WA */
waWebSocketUrl: string | URL
@@ -104,8 +106,8 @@ export type SocketConfig = {
* */
patchMessageBeforeSending: (
msg: proto.IMessage,
recipientJids: string[],
) => Promise<proto.IMessage> | proto.IMessage
recipientJids?: string[],
) => Promise<PatchedMessageWithRecipientJID[] | PatchedMessageWithRecipientJID> | PatchedMessageWithRecipientJID[] | PatchedMessageWithRecipientJID
/** verify app state MACs */
appStateMacVerification: {