File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,13 +35,13 @@ export const WA_CERT_DETAILS = {
3535}
3636
3737export const PROCESSABLE_HISTORY_TYPES = [
38- proto . Message . HistorySyncNotification . HistorySyncType . INITIAL_BOOTSTRAP ,
39- proto . Message . HistorySyncNotification . HistorySyncType . PUSH_NAME ,
40- proto . Message . HistorySyncNotification . HistorySyncType . RECENT ,
41- proto . Message . HistorySyncNotification . HistorySyncType . FULL ,
42- proto . Message . HistorySyncNotification . HistorySyncType . ON_DEMAND ,
43- proto . Message . HistorySyncNotification . HistorySyncType . NON_BLOCKING_DATA ,
44- proto . Message . HistorySyncNotification . HistorySyncType . INITIAL_STATUS_V3
38+ proto . HistorySync . HistorySyncType . INITIAL_BOOTSTRAP ,
39+ proto . HistorySync . HistorySyncType . PUSH_NAME ,
40+ proto . HistorySync . HistorySyncType . RECENT ,
41+ proto . HistorySync . HistorySyncType . FULL ,
42+ proto . HistorySync . HistorySyncType . ON_DEMAND ,
43+ proto . HistorySync . HistorySyncType . NON_BLOCKING_DATA ,
44+ proto . HistorySync . HistorySyncType . INITIAL_STATUS_V3 ,
4545]
4646
4747export const DEFAULT_CONNECTION_CONFIG : SocketConfig = {
Original file line number Diff line number Diff line change @@ -1036,7 +1036,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
10361036
10371037 const historyMsg = getHistoryMsg ( msg . message ! )
10381038 const shouldProcessHistoryMsg = historyMsg
1039- ? shouldSyncHistoryMessage ( historyMsg ) && PROCESSABLE_HISTORY_TYPES . includes ( historyMsg . syncType ! )
1039+ ? shouldSyncHistoryMessage ( historyMsg ) && PROCESSABLE_HISTORY_TYPES . includes ( historyMsg . syncType ! as proto . HistorySync . HistorySyncType )
10401040 : false
10411041
10421042 // State machine: decide on sync and flush
Original file line number Diff line number Diff line change @@ -96,7 +96,12 @@ export const downloadAndProcessHistorySyncNotification = async (
9696 msg : proto . Message . IHistorySyncNotification ,
9797 options : RequestInit
9898) => {
99- const historyMsg = await downloadHistory ( msg , options )
99+ let historyMsg : proto . HistorySync
100+ if ( msg . initialHistBootstrapInlinePayload ) {
101+ historyMsg = proto . HistorySync . decode ( await inflatePromise ( msg . initialHistBootstrapInlinePayload ) )
102+ } else {
103+ historyMsg = await downloadHistory ( msg , options )
104+ }
100105 return processHistoryMessage ( historyMsg )
101106}
102107
You can’t perform that action at this time.
0 commit comments