Skip to content

Commit

Permalink
fix(feature/pdo-sync): Make progress optional
Browse files Browse the repository at this point in the history
  • Loading branch information
purpshell committed Aug 2, 2024
1 parent bc46677 commit eeb95c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Types/Events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export type BaileysEventMap = {
contacts: Contact[]
messages: WAMessage[]
isLatest?: boolean
progress: number
syncType: proto.HistorySync.HistorySyncType
progress?: number | null
syncType?: proto.HistorySync.HistorySyncType
}
/** upsert chats */
'chats.upsert': Chat[]
Expand Down
4 changes: 2 additions & 2 deletions src/Utils/process-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AuthenticationCreds, BaileysEventEmitter, CacheStore, Chat, GroupMetada
import { getContentType, normalizeMessageContent } from '../Utils/messages'
import { areJidsSameUser, isJidBroadcast, isJidStatusBroadcast, jidNormalizedUser } from '../WABinary'
import { aesDecryptGCM, hmacSign } from './crypto'
import { delay, getKeyAuthor, toNumber } from './generics'
import { getKeyAuthor, toNumber } from './generics'
import { downloadAndProcessHistorySyncNotification } from './history'

type ProcessMessageContext = {
Expand Down Expand Up @@ -34,7 +34,7 @@ const REAL_MSG_REQ_ME_STUB_TYPES = new Set([
export const cleanMessage = (message: proto.IWebMessageInfo, meId: string) => {
// ensure remoteJid and participant doesn't have device or agent in it
message.key.remoteJid = jidNormalizedUser(message.key.remoteJid!)
message.key.participant = message.key.participant ? jidNormalizedUser(message.key.participant!) : undefined
message.key.participant = message.key.participant ? jidNormalizedUser(message.key.participant) : undefined
const content = normalizeMessageContent(message.message)
// if the message has a reaction, ensure fromMe & remoteJid are from our perspective
if(content?.reactionMessage) {
Expand Down

0 comments on commit eeb95c9

Please sign in to comment.