mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: pass axios config to all axios instances
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { AxiosRequestConfig } from 'axios'
|
||||
import type { Logger } from 'pino'
|
||||
import { proto } from '../../WAProto'
|
||||
import { AuthenticationCreds, BaileysEventEmitter, Chat, GroupMetadata, InitialReceivedChatsState, ParticipantAction, SignalKeyStoreWithTransaction, WAMessageStubType } from '../Types'
|
||||
@@ -12,6 +13,7 @@ type ProcessMessageContext = {
|
||||
keyStore: SignalKeyStoreWithTransaction
|
||||
ev: BaileysEventEmitter
|
||||
logger?: Logger
|
||||
options: AxiosRequestConfig<any>
|
||||
}
|
||||
|
||||
const MSG_MISSED_CALL_TYPES = new Set([
|
||||
@@ -64,7 +66,7 @@ export const shouldIncrementChatUnread = (message: proto.IWebMessageInfo) => (
|
||||
|
||||
const processMessage = async(
|
||||
message: proto.IWebMessageInfo,
|
||||
{ downloadHistory, ev, historyCache, recvChats, creds, keyStore, logger }: ProcessMessageContext
|
||||
{ downloadHistory, ev, historyCache, recvChats, creds, keyStore, logger, options }: ProcessMessageContext
|
||||
) => {
|
||||
const meId = creds.me!.id
|
||||
const { accountSettings } = creds
|
||||
@@ -95,7 +97,12 @@ const processMessage = async(
|
||||
|
||||
if(downloadHistory) {
|
||||
const isLatest = !creds.processedHistoryMessages?.length
|
||||
const { chats, contacts, messages, didProcess } = await downloadAndProcessHistorySyncNotification(histNotification, historyCache, recvChats)
|
||||
const { chats, contacts, messages, didProcess } = await downloadAndProcessHistorySyncNotification(
|
||||
histNotification,
|
||||
historyCache,
|
||||
recvChats,
|
||||
options
|
||||
)
|
||||
|
||||
if(chats.length) {
|
||||
ev.emit('chats.set', { chats, isLatest })
|
||||
|
||||
Reference in New Issue
Block a user