Compare commits

...

3 Commits

Author SHA1 Message Date
Matheus Filype 6afde71691 feat: groups mention all (#2396)
* fix: improve message resend logic by adding checks for message IDs

* Revert "fix: improve message resend logic by adding checks for message IDs"

This reverts commit c03f9d8e6fc6cbfbb9d1f8f67c169700e704213d.

* feat: add mentionAll support to message context for group mentions

* fix: improve readability of condition for mentions and mentionAll in generateWAMessageContent

* Apply suggestions from code review

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>

---------

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
2026-03-13 19:49:16 +02:00
ShellTear ad5ea817f7 Merge pull request #2360 from WhiskeySockets/update-version/stable 2026-02-25 01:33:33 +09:00
github-actions[bot] 3841abca35 chore: update WhatsApp Web version 2026-02-22 00:43:34 +00:00
5 changed files with 17 additions and 9 deletions
+1 -1
View File
@@ -1 +1 @@
{"version":[2,3000,1033105955]} {"version":[2,3000,1033846690]}
+1 -1
View File
@@ -4,7 +4,7 @@ import type { AuthenticationState, SocketConfig, WAVersion } from '../Types'
import { Browsers } from '../Utils/browser-utils' import { Browsers } from '../Utils/browser-utils'
import logger from '../Utils/logger' import logger from '../Utils/logger'
const version = [2, 3000, 1033105955] const version = [2, 3000, 1033846690]
export const UNAUTHORIZED_CODES = [401, 403, 419] export const UNAUTHORIZED_CODES = [401, 403, 419]
+2
View File
@@ -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 */
+1 -1
View File
@@ -1,7 +1,7 @@
import { Boom } from '@hapi/boom' import { Boom } from '@hapi/boom'
import { createHash, randomBytes } from 'crypto' import { createHash, randomBytes } from 'crypto'
import { proto } from '../../WAProto/index.js' import { proto } from '../../WAProto/index.js'
const baileysVersion = [2, 3000, 1033105955] const baileysVersion = [2, 3000, 1033846690]
import type { import type {
BaileysEventEmitter, BaileysEventEmitter,
BaileysEventMap, BaileysEventMap,
+12 -6
View File
@@ -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
} }
} }
} }