@neelegirly/baileys 2.2.32 → 2.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/lib/Utils/messages.js +4 -0
- package/package.json +4 -3
- package/tests/carousel-wire.test.cjs +44 -0
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<img src="https://files.catbox.moe/5bqumy.jpeg" width="780" alt="@neelegirly/baileys Hero" />
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
|
-
<p align="center"><sub>2026 Glow-Up Edition · self-healing QR/Pairing · Companion-Stack auf <strong>2.2.
|
|
18
|
+
<p align="center"><sub>2026 Glow-Up Edition · self-healing QR/Pairing · Companion-Stack auf <strong>2.2.33 / 1.8.14 / 1.0.33</strong></sub></p>
|
|
19
19
|
|
|
20
20
|
[**Installation**](#-installation) · [**Quickstart**](#-quickstart) · [**Was ist dieser Fork?**](#-was-ist-dieser-fork) · [**Versionsschema**](#-versionsschema) · [**Message-ID**](#-message-id-anpassung-neele) · [**Release Notes**](#-release-notes-2230)
|
|
21
21
|
|
|
@@ -185,6 +185,16 @@ Beim QR-Scan werden Markenzeilen ober- und unterhalb des QR-Codes ausgegeben. Ve
|
|
|
185
185
|
|
|
186
186
|
---
|
|
187
187
|
|
|
188
|
+
## 📝 Release Notes `2.2.33`
|
|
189
|
+
|
|
190
|
+
`patchMessageForMdIfRequired` erhält jetzt die vom Aufrufer übergebene rohe
|
|
191
|
+
`interactiveMessage.carouselMessage`-Struktur. Der bisherige automatische
|
|
192
|
+
View-once-Patch für einzelne Karten wird nicht mehr auf rohe Karussells
|
|
193
|
+
angewendet. Bereits ausdrücklich umhüllte Nachrichten bleiben erhalten;
|
|
194
|
+
einzelne interaktive Karten, Listen und Templates behalten ihren bisherigen
|
|
195
|
+
MD-Patch. Die Darstellung der verwendeten Knöpfe muss weiterhin auf den
|
|
196
|
+
jeweiligen WhatsApp-Clients geprüft werden.
|
|
197
|
+
|
|
188
198
|
## 📝 Release Notes `2.2.32`
|
|
189
199
|
|
|
190
200
|
`prepareInteractiveMessageForMd(message)` ergänzt für eine interaktive Karte
|
package/lib/Utils/messages.js
CHANGED
|
@@ -1556,6 +1556,10 @@ const assertMediaContent = (content) => {
|
|
|
1556
1556
|
* Don't know how it works, but it does for now
|
|
1557
1557
|
*/
|
|
1558
1558
|
const patchMessageForMdIfRequired = (message) => {
|
|
1559
|
+
// ONIMAI(carousel): A raw carousel already carries its card-native flows.
|
|
1560
|
+
// Keep the caller's wire shape instead of forcing it into the legacy
|
|
1561
|
+
// single-card viewOnce patch. Explicitly wrapped messages stay untouched.
|
|
1562
|
+
if (message?.interactiveMessage?.carouselMessage) return message
|
|
1559
1563
|
if (message?.buttonsMessage ||
|
|
1560
1564
|
message?.templateMessage ||
|
|
1561
1565
|
message?.listMessage ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neelegirly/baileys",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.33",
|
|
4
4
|
"description": "Eigenstaendiger Baileys-Fork von Neele Girl (NICHT WhiskeySockets/Baileys) — multi-device WhatsApp Web API fuer Node.js, mit Multi-Button-Support, QR-/Pairing-Stabilitaet und self-healing WA-Web-Version.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"whatsapp",
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"tsconfig.json",
|
|
34
34
|
"README.md",
|
|
35
35
|
"LICENSE",
|
|
36
|
-
"tests/interactive-envelope.test.cjs"
|
|
36
|
+
"tests/interactive-envelope.test.cjs",
|
|
37
|
+
"tests/carousel-wire.test.cjs"
|
|
37
38
|
],
|
|
38
39
|
"exports": {
|
|
39
40
|
".": {
|
|
@@ -123,6 +124,6 @@
|
|
|
123
124
|
"build:all": "tsc && typedoc",
|
|
124
125
|
"build:docs": "typedoc",
|
|
125
126
|
"build:tsc": "tsc",
|
|
126
|
-
"test": "node --check lib/Socket/groups.js && node --check lib/Socket/messages-recv.js && node --check lib/Socket/messages-send.js && node --check lib/Socket/socket.js && node --check lib/Utils/auth-utils.js && node --check lib/Utils/decode-wa-message.js && node --check lib/Utils/process-message.js && node --check lib/Utils/link-preview.js && node -e \"const b=require('./'); if(typeof b.makeWASocket !== 'function' || b.NACK_REASONS.SenderReachoutTimelocked !== 463 || b.QueryIds.FOLLOW !== '24404358912487870') process.exit(1)\" && node --test tests/interactive-envelope.test.cjs"
|
|
127
|
+
"test": "node --check lib/Socket/groups.js && node --check lib/Socket/messages-recv.js && node --check lib/Socket/messages-send.js && node --check lib/Socket/socket.js && node --check lib/Utils/auth-utils.js && node --check lib/Utils/decode-wa-message.js && node --check lib/Utils/process-message.js && node --check lib/Utils/link-preview.js && node -e \"const b=require('./'); if(typeof b.makeWASocket !== 'function' || b.NACK_REASONS.SenderReachoutTimelocked !== 463 || b.QueryIds.FOLLOW !== '24404358912487870') process.exit(1)\" && node --test tests/interactive-envelope.test.cjs tests/carousel-wire.test.cjs"
|
|
127
128
|
}
|
|
128
129
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const test = require('node:test');
|
|
3
|
+
const assert = require('node:assert/strict');
|
|
4
|
+
const { patchMessageForMdIfRequired, generateWAMessageFromContent } = require('../lib/Utils/messages.js');
|
|
5
|
+
const { proto } = require('../WAProto');
|
|
6
|
+
|
|
7
|
+
const sample = () => ({ interactiveMessage: { body: { text: 'Carousel' }, carouselMessage: { cards: [
|
|
8
|
+
{ header: { title: 'Categories', hasMediaAttachment: true, imageMessage: { mimetype: 'image/jpeg', mediaKey: Buffer.alloc(32) } },
|
|
9
|
+
nativeFlowMessage: { buttons: [1, 2, 3].map(n => ({ name: 'single_select', buttonParamsJson: JSON.stringify({
|
|
10
|
+
title: 'Group ' + n, sections: [{ title: 'Categories', rows: [{ title: 'Option ' + n, id: '!menu ' + n }] }]
|
|
11
|
+
}) })) } },
|
|
12
|
+
{ header: { title: 'Links', hasMediaAttachment: true, imageMessage: { mimetype: 'image/jpeg', mediaKey: Buffer.alloc(32) } },
|
|
13
|
+
nativeFlowMessage: { buttons: [1, 2, 3].map(n => ({ name: 'cta_url', buttonParamsJson: JSON.stringify({ display_text: 'Link ' + n, url: 'https://example.com/' + n }) })) } }
|
|
14
|
+
] } } });
|
|
15
|
+
|
|
16
|
+
test('transport patch keeps raw multi-select carousel wire shape and caller metadata', () => {
|
|
17
|
+
const input = sample(); input.messageContextInfo = { messageSecret: Buffer.alloc(32, 9) };
|
|
18
|
+
assert.equal(patchMessageForMdIfRequired(input), input);
|
|
19
|
+
const generated = generateWAMessageFromContent('12345@s.whatsapp.net', input, { userJid: '67890@s.whatsapp.net' });
|
|
20
|
+
const wire = proto.Message.decode(proto.Message.encode(patchMessageForMdIfRequired(generated.message)).finish());
|
|
21
|
+
assert.ok(wire.interactiveMessage.carouselMessage);
|
|
22
|
+
assert.equal(wire.viewOnceMessageV2Extension, null);
|
|
23
|
+
assert.equal(wire.interactiveMessage.carouselMessage.cards.length, 2);
|
|
24
|
+
assert.deepEqual(wire.interactiveMessage.carouselMessage.cards[0].nativeFlowMessage.buttons.map(b => b.name), ['single_select', 'single_select', 'single_select']);
|
|
25
|
+
assert.equal(wire.messageContextInfo.messageSecret.length, 32);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('single-card interactive, buttons, list and template retain their existing MD patch', () => {
|
|
29
|
+
for (const key of ['interactiveMessage', 'buttonsMessage', 'listMessage', 'templateMessage']) {
|
|
30
|
+
const input = { [key]: {} }, result = patchMessageForMdIfRequired(input);
|
|
31
|
+
assert.equal(result.viewOnceMessageV2Extension.message[key], input[key]);
|
|
32
|
+
assert.equal(result.viewOnceMessageV2Extension.message.messageContextInfo.deviceListMetadataVersion, 2);
|
|
33
|
+
assert.equal(input.viewOnceMessageV2Extension, undefined);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test('explicit carousel wrappers, ephemeral messages and ordinary messages are not rewritten', () => {
|
|
38
|
+
for (const input of [
|
|
39
|
+
{ viewOnceMessage: { message: sample() } },
|
|
40
|
+
{ viewOnceMessageV2Extension: { message: sample() } },
|
|
41
|
+
{ ephemeralMessage: { message: sample() } },
|
|
42
|
+
{ conversation: 'Normal message' }
|
|
43
|
+
]) assert.equal(patchMessageForMdIfRequired(input), input);
|
|
44
|
+
});
|