Interface IReferenceMessagesRepository

interface IReferenceMessagesRepository {
    delete: ((chatId: number, msgIds: number[]) => MaybePromise<void>);
    deleteAll: (() => MaybePromise<void>);
    deleteByPeer: ((peerId: number) => MaybePromise<void>);
    getByPeer: ((peerId: number) => MaybePromise<null | [number, number]>);
    store: ((peerId: number, chatId: number, msgId: number) => MaybePromise<void>);
}

Properties

delete: ((chatId: number, msgIds: number[]) => MaybePromise<void>)

Delete reference messages given the chatId where msgId is one of msgIds

deleteAll: (() => MaybePromise<void>)
deleteByPeer: ((peerId: number) => MaybePromise<void>)
getByPeer: ((peerId: number) => MaybePromise<null | [number, number]>)

Get the reference message for the given peerId.

If more than one reference message is stored for the given peerId, the one with the highest msgId should be returned, but this is not really important.

store: ((peerId: number, chatId: number, msgId: number) => MaybePromise<void>)

Store a reference message