chore: remove legacy code

This commit is contained in:
Adhiraj Singh
2022-09-19 14:59:35 +05:30
parent d73585ede9
commit e7f6838fa4
23 changed files with 91 additions and 2921 deletions

View File

@@ -1,4 +1,4 @@
import type { CommonSocketConfig, LegacySocketConfig, MediaType, SocketConfig } from '../Types'
import type { MediaType, SocketConfig } from '../Types'
import { Browsers } from '../Utils'
import logger from '../Utils/logger'
import { version } from './baileys-version.json'
@@ -26,10 +26,9 @@ export const WA_CERT_DETAILS = {
SERIAL: 0,
}
const BASE_CONNECTION_CONFIG: CommonSocketConfig = {
export const DEFAULT_CONNECTION_CONFIG: SocketConfig = {
version: version as any,
browser: Browsers.baileys('Chrome'),
waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat',
connectTimeoutMs: 20_000,
keepAliveIntervalMs: 15_000,
@@ -38,11 +37,7 @@ const BASE_CONNECTION_CONFIG: CommonSocketConfig = {
emitOwnEvents: true,
defaultQueryTimeoutMs: 60_000,
customUploadHosts: [],
retryRequestDelayMs: 250
}
export const DEFAULT_CONNECTION_CONFIG: SocketConfig = {
...BASE_CONNECTION_CONFIG,
retryRequestDelayMs: 250,
fireInitQueries: true,
auth: undefined as any,
downloadHistory: true,
@@ -54,13 +49,6 @@ export const DEFAULT_CONNECTION_CONFIG: SocketConfig = {
getMessage: async() => undefined
}
export const DEFAULT_LEGACY_CONNECTION_CONFIG: LegacySocketConfig = {
...BASE_CONNECTION_CONFIG,
waWebSocketUrl: 'wss://web.whatsapp.com/ws',
phoneResponseTimeMs: 20_000,
expectResponseTimeout: 60_000,
}
export const MEDIA_PATH_MAP: { [T in MediaType]?: string } = {
image: '/mms/image',
video: '/mms/video',