Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6afde71691 |
@@ -113,6 +113,8 @@ export interface WAUrlInfo {
|
|||||||
type Mentionable = {
|
type Mentionable = {
|
||||||
/** list of jids that are mentioned in the accompanying text */
|
/** list of jids that are mentioned in the accompanying text */
|
||||||
mentions?: string[]
|
mentions?: string[]
|
||||||
|
/** mention all */
|
||||||
|
mentionAll?: boolean
|
||||||
}
|
}
|
||||||
type Contextable = {
|
type Contextable = {
|
||||||
/** add contextInfo to the message */
|
/** add contextInfo to the message */
|
||||||
|
|||||||
+12
-6
@@ -609,14 +609,20 @@ export const generateWAMessageContent = async (
|
|||||||
m = { viewOnceMessage: { message: m } }
|
m = { viewOnceMessage: { message: m } }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasOptionalProperty(message, 'mentions') && message.mentions?.length) {
|
if (
|
||||||
|
(hasOptionalProperty(message, 'mentions') && message.mentions?.length) ||
|
||||||
|
(hasOptionalProperty(message, 'mentionAll') && message.mentionAll)
|
||||||
|
) {
|
||||||
const messageType = Object.keys(m)[0]! as Extract<keyof proto.IMessage, MessageWithContextInfo>
|
const messageType = Object.keys(m)[0]! as Extract<keyof proto.IMessage, MessageWithContextInfo>
|
||||||
const key = m[messageType]
|
const key = m[messageType]
|
||||||
if ('contextInfo' in key! && !!key.contextInfo) {
|
if (key && 'contextInfo' in key) {
|
||||||
key.contextInfo.mentionedJid = message.mentions
|
key.contextInfo = key.contextInfo || {}
|
||||||
} else if (key!) {
|
if (message.mentions?.length) {
|
||||||
key.contextInfo = {
|
key.contextInfo.mentionedJid = message.mentions
|
||||||
mentionedJid: message.mentions
|
}
|
||||||
|
|
||||||
|
if (message.mentionAll) {
|
||||||
|
key.contextInfo.nonJidMentions = 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user