feat: cache user devices

This commit is contained in:
Adhiraj Singh
2021-11-07 19:51:14 +05:30
parent ba502f0436
commit dee815448b
6 changed files with 64 additions and 12 deletions

View File

@@ -9,6 +9,7 @@ import type EventEmitter from "events"
import type { Agent } from "https"
import type { Logger } from "pino"
import type { URL } from "url"
import type NodeCache from 'node-cache'
import { AuthenticationState } from './Auth'
import { Chat, PresenceData } from './Chat'
@@ -45,6 +46,8 @@ export type SocketConfig = {
printQRInTerminal: boolean
/** should events be emitted for actions done by this socket connection */
emitOwnEvents: boolean
/** provide a cache to store a user's device list */
userDevicesCache?: NodeCache
}
export enum DisconnectReason {