Skip to content

Commit

Permalink
chore: add "documentWithCaptionMessage" to normalise msg
Browse files Browse the repository at this point in the history
  • Loading branch information
adiwajshing committed Nov 23, 2022
1 parent 7f2384a commit f1ca770
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Utils/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ export const normalizeMessageContent = (content: WAMessageContent | null | undef
content = content?.ephemeralMessage?.message?.viewOnceMessage?.message ||
content?.ephemeralMessage?.message ||
content?.viewOnceMessage?.message ||
content?.documentWithCaptionMessage?.message ||
content ||
undefined
return content
Expand All @@ -592,7 +593,12 @@ export const extractMessageContent = (content: WAMessageContent | undefined | nu
} else if(msg.locationMessage) {
return { locationMessage: msg.locationMessage }
} else {
return { conversation: 'contentText' in msg ? msg.contentText : ('hydratedContentText' in msg ? msg.hydratedContentText : '') }
return {
conversation:
'contentText' in msg
? msg.contentText
: ('hydratedContentText' in msg ? msg.hydratedContentText : '')
}
}
}

Expand Down

0 comments on commit f1ca770

Please sign in to comment.