mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
refactor: process sync actions out of socket
This commit is contained in:
@@ -27,6 +27,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
relayMessage,
|
||||
sendReceipt,
|
||||
resyncMainAppState,
|
||||
emitEventsFromMap,
|
||||
} = sock
|
||||
|
||||
/** this mutex ensures that the notifications (receipts, messages etc.) are processed in order */
|
||||
@@ -131,12 +132,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
})
|
||||
}
|
||||
|
||||
const emitEventsFromMap = (map: Partial<BaileysEventMap<any>>) => {
|
||||
for(const key in map) {
|
||||
ev.emit(key as any, map[key])
|
||||
}
|
||||
}
|
||||
|
||||
const processMessageLocal = async(message: proto.IWebMessageInfo) => {
|
||||
const meId = authState.creds.me!.id
|
||||
// send ack for history message
|
||||
|
||||
Reference in New Issue
Block a user