mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: implement message retry handling
so if a message fails to decrypt on the other user's end -- it can be retried
This commit is contained in:
@@ -117,6 +117,8 @@ export type AnyMessageContent = AnyRegularMessageContent | {
|
||||
|
||||
export type MessageRelayOptions = {
|
||||
messageId?: string
|
||||
/** only send to a specific participant */
|
||||
participant?: string
|
||||
additionalAttributes?: { [_: string]: string }
|
||||
cachedGroupMetadata?: (jid: string) => Promise<GroupMetadata | undefined>
|
||||
//cachedDevices?: (jid: string) => Promise<string[] | undefined>
|
||||
|
||||
@@ -18,6 +18,7 @@ import { ConnectionState } from './State'
|
||||
|
||||
import { GroupMetadata, ParticipantAction } from './GroupMetadata'
|
||||
import { MessageInfoUpdate, MessageUpdateType, WAMessage, WAMessageUpdate, WAMessageKey } from './Message'
|
||||
import { proto } from '../../WAProto'
|
||||
|
||||
export type WAVersion = [number, number, number]
|
||||
export type WABrowserDescription = [string, string, string]
|
||||
@@ -54,6 +55,11 @@ export type SocketConfig = {
|
||||
mediaCache?: NodeCache
|
||||
/** map to store the retry counts for failed messages */
|
||||
msgRetryCounterMap?: { [msgId: string]: number }
|
||||
/**
|
||||
* fetch a message from your store
|
||||
* implement this so that messages failed to send (solves the "this message can take a while" issue) can be retried
|
||||
* */
|
||||
getMessage: (key: proto.IMessageKey) => Promise<proto.IMessage | undefined>
|
||||
}
|
||||
|
||||
export enum DisconnectReason {
|
||||
|
||||
Reference in New Issue
Block a user