diff --git a/src/Types/Events.ts b/src/Types/Events.ts index d97320c0..757b4308 100644 --- a/src/Types/Events.ts +++ b/src/Types/Events.ts @@ -27,6 +27,7 @@ export type BaileysEventMap = { chats: Chat[] contacts: Contact[] messages: WAMessage[] + pastParticipants?: proto.IPastParticipants[] | null isLatest?: boolean progress?: number | null syncType?: proto.HistorySync.HistorySyncType | null @@ -185,6 +186,7 @@ export type BufferedEventData = { chats: { [jid: string]: Chat } contacts: { [jid: string]: Contact } messages: { [uqId: string]: WAMessage } + pastParticipants?: proto.IPastParticipants[] empty: boolean isLatest: boolean progress?: number | null diff --git a/src/Utils/event-buffer.ts b/src/Utils/event-buffer.ts index 1b19a3e8..3bf7bbd1 100644 --- a/src/Utils/event-buffer.ts +++ b/src/Utils/event-buffer.ts @@ -967,6 +967,10 @@ function append( } } + data.historySets.pastParticipants = [ + ...(data.historySets.pastParticipants || []), + ...(eventData.pastParticipants || []) + ] data.historySets.empty = false data.historySets.syncType = eventData.syncType data.historySets.progress = eventData.progress @@ -1292,6 +1296,7 @@ function consolidateEvents(data: BufferedEventData) { chats: Object.values(data.historySets.chats), messages: Object.values(data.historySets.messages), contacts: Object.values(data.historySets.contacts), + pastParticipants: data.historySets.pastParticipants, syncType: data.historySets.syncType, progress: data.historySets.progress, isLatest: data.historySets.isLatest, diff --git a/src/Utils/history.ts b/src/Utils/history.ts index 6442abf2..5f5f9547 100644 --- a/src/Utils/history.ts +++ b/src/Utils/history.ts @@ -378,6 +378,7 @@ export const processHistoryMessage = (item: proto.IHistorySync, logger?: ILogger chats, contacts, messages, + pastParticipants: item.pastParticipants, lidPnMappings, syncType: item.syncType, progress: item.progress