@blurose/baileys 1.1.4 → 1.1.5

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 CHANGED
@@ -13,10 +13,12 @@
13
13
 
14
14
  ## Maintenance Status & Compatibility
15
15
 
16
- Active maintained release: **1.1.4**
16
+ Active maintained release: **1.1.5**
17
17
 
18
18
  ### Key Enhancements & Compatibility Provided
19
19
 
20
+ - **Group Participant Safety (1.1.5)**: Safe try-catch parsing for `messageStubParameters` preventing crashes on raw participant events.
21
+ - **Link Preview Safety (1.1.5)**: Silent fallback handling on link preview thumbnail fetch failures.
20
22
  - **Newsletter Media Patch**: Automatically maps correct CDN upload endpoints and formats stanzas so media displays perfectly in WhatsApp Channels.
21
23
  - **MessageBuilder v4.6 (Built-in)**: Chainable API for creating Buttons, Carousels, Native Flow messages, and AI Rich Response payloads natively from the library.
22
24
  - **Legacy Store Helpers**:
@@ -507,12 +507,26 @@ const processMessage = async (message, { shouldProcessHistoryMsg, placeholderRes
507
507
  const participantsIncludesMe = () => participants.find(jid => areJidsSameUser(meId, jid.phoneNumber)); // ADD SUPPORT FOR LID
508
508
  switch (message.messageStubType) {
509
509
  case WAMessageStubType.GROUP_PARTICIPANT_CHANGE_NUMBER:
510
- participants = message.messageStubParameters.map((a) => JSON.parse(a)) || [];
510
+ participants = message.messageStubParameters.map((a) => {
511
+ try {
512
+ return JSON.parse(a);
513
+ }
514
+ catch (_a) {
515
+ return a;
516
+ }
517
+ }) || [];
511
518
  emitParticipantsUpdate('modify');
512
519
  break;
513
520
  case WAMessageStubType.GROUP_PARTICIPANT_LEAVE:
514
521
  case WAMessageStubType.GROUP_PARTICIPANT_REMOVE:
515
- participants = message.messageStubParameters.map((a) => JSON.parse(a)) || [];
522
+ participants = message.messageStubParameters.map((a) => {
523
+ try {
524
+ return JSON.parse(a);
525
+ }
526
+ catch (_a) {
527
+ return a;
528
+ }
529
+ }) || [];
516
530
  emitParticipantsUpdate('remove');
517
531
  // mark the chat read only if you left the group
518
532
  if (participantsIncludesMe()) {
@@ -522,18 +536,39 @@ const processMessage = async (message, { shouldProcessHistoryMsg, placeholderRes
522
536
  case WAMessageStubType.GROUP_PARTICIPANT_ADD:
523
537
  case WAMessageStubType.GROUP_PARTICIPANT_INVITE:
524
538
  case WAMessageStubType.GROUP_PARTICIPANT_ADD_REQUEST_JOIN:
525
- participants = message.messageStubParameters.map((a) => JSON.parse(a)) || [];
539
+ participants = message.messageStubParameters.map((a) => {
540
+ try {
541
+ return JSON.parse(a);
542
+ }
543
+ catch (_a) {
544
+ return a;
545
+ }
546
+ }) || [];
526
547
  if (participantsIncludesMe()) {
527
548
  chat.readOnly = false;
528
549
  }
529
550
  emitParticipantsUpdate('add');
530
551
  break;
531
552
  case WAMessageStubType.GROUP_PARTICIPANT_DEMOTE:
532
- participants = message.messageStubParameters.map((a) => JSON.parse(a)) || [];
553
+ participants = message.messageStubParameters.map((a) => {
554
+ try {
555
+ return JSON.parse(a);
556
+ }
557
+ catch (_a) {
558
+ return a;
559
+ }
560
+ }) || [];
533
561
  emitParticipantsUpdate('demote');
534
562
  break;
535
563
  case WAMessageStubType.GROUP_PARTICIPANT_PROMOTE:
536
- participants = message.messageStubParameters.map((a) => JSON.parse(a)) || [];
564
+ participants = message.messageStubParameters.map((a) => {
565
+ try {
566
+ return JSON.parse(a);
567
+ }
568
+ catch (_a) {
569
+ return a;
570
+ }
571
+ }) || [];
537
572
  emitParticipantsUpdate('promote');
538
573
  break;
539
574
  case WAMessageStubType.GROUP_CHANGE_ANNOUNCE:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blurose/baileys",
3
3
  "type": "module",
4
- "version": "1.1.4",
4
+ "version": "1.1.5",
5
5
  "description": "A WebSockets library for interacting with WhatsApp Web",
6
6
  "keywords": [
7
7
  "whatsapp",