@itsliaaa/baileys 0.1.11 → 0.1.12

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/WAProto/index.js CHANGED
@@ -26071,10 +26071,6 @@ export const proto = $root.proto = (() => {
26071
26071
  case 3:
26072
26072
  m.limitSharingTrigger = 3;
26073
26073
  break;
26074
- case "DEPRECATION":
26075
- case 4:
26076
- m.limitSharingTrigger = 4;
26077
- break;
26078
26074
  }
26079
26075
  if (d.limitSharingInitiatedByMe != null) {
26080
26076
  m.limitSharingInitiatedByMe = Boolean(d.limitSharingInitiatedByMe);
@@ -35927,10 +35923,6 @@ export const proto = $root.proto = (() => {
35927
35923
  case 3:
35928
35924
  m.trigger = 3;
35929
35925
  break;
35930
- case "DEPRECATION":
35931
- case 4:
35932
- m.trigger = 4;
35933
- break;
35934
35926
  }
35935
35927
  if (d.limitSharingSettingTimestamp != null) {
35936
35928
  if ($util.Long)
@@ -35995,7 +35987,6 @@ export const proto = $root.proto = (() => {
35995
35987
  values[valuesById[1] = "CHAT_SETTING"] = 1;
35996
35988
  values[valuesById[2] = "BIZ_SUPPORTS_FB_HOSTING"] = 2;
35997
35989
  values[valuesById[3] = "UNKNOWN_GROUP"] = 3;
35998
- values[valuesById[4] = "DEPRECATION"] = 4;
35999
35990
  return values;
36000
35991
  })();
36001
35992
 
@@ -85456,6 +85447,7 @@ export const proto = $root.proto = (() => {
85456
85447
  BusinessBroadcastListAction.prototype.participants = $util.emptyArray;
85457
85448
  BusinessBroadcastListAction.prototype.listName = null;
85458
85449
  BusinessBroadcastListAction.prototype.labelIds = $util.emptyArray;
85450
+ BusinessBroadcastListAction.prototype.audienceExpression = null;
85459
85451
 
85460
85452
  let $oneOfFields;
85461
85453
 
@@ -85469,6 +85461,11 @@ export const proto = $root.proto = (() => {
85469
85461
  set: $util.oneOfSetter($oneOfFields)
85470
85462
  });
85471
85463
 
85464
+ Object.defineProperty(BusinessBroadcastListAction.prototype, "_audienceExpression", {
85465
+ get: $util.oneOfGetter($oneOfFields = ["audienceExpression"]),
85466
+ set: $util.oneOfSetter($oneOfFields)
85467
+ });
85468
+
85472
85469
  BusinessBroadcastListAction.create = function create(properties) {
85473
85470
  return new BusinessBroadcastListAction(properties);
85474
85471
  };
@@ -85488,6 +85485,8 @@ export const proto = $root.proto = (() => {
85488
85485
  for (var i = 0; i < m.labelIds.length; ++i)
85489
85486
  w.uint32(34).string(m.labelIds[i]);
85490
85487
  }
85488
+ if (m.audienceExpression != null && Object.hasOwnProperty.call(m, "audienceExpression"))
85489
+ w.uint32(42).string(m.audienceExpression);
85491
85490
  return w;
85492
85491
  };
85493
85492
 
@@ -85520,6 +85519,10 @@ export const proto = $root.proto = (() => {
85520
85519
  m.labelIds.push(r.string());
85521
85520
  break;
85522
85521
  }
85522
+ case 5: {
85523
+ m.audienceExpression = r.string();
85524
+ break;
85525
+ }
85523
85526
  default:
85524
85527
  r.skipType(t & 7);
85525
85528
  break;
@@ -85556,6 +85559,9 @@ export const proto = $root.proto = (() => {
85556
85559
  m.labelIds[i] = String(d.labelIds[i]);
85557
85560
  }
85558
85561
  }
85562
+ if (d.audienceExpression != null) {
85563
+ m.audienceExpression = String(d.audienceExpression);
85564
+ }
85559
85565
  return m;
85560
85566
  };
85561
85567
 
@@ -85589,6 +85595,11 @@ export const proto = $root.proto = (() => {
85589
85595
  d.labelIds[j] = m.labelIds[j];
85590
85596
  }
85591
85597
  }
85598
+ if (m.audienceExpression != null && m.hasOwnProperty("audienceExpression")) {
85599
+ d.audienceExpression = m.audienceExpression;
85600
+ if (o.oneofs)
85601
+ d._audienceExpression = "audienceExpression";
85602
+ }
85592
85603
  return d;
85593
85604
  };
85594
85605
 
@@ -698,7 +698,8 @@ export const getWAUploadToServer = ({ customUploadHosts, fetchAgent, logger, opt
698
698
  const auth = encodeURIComponent(uploadInfo.auth);
699
699
  // Lia@Changes 06-02-26 --- Switch media path map for newsletter uploads
700
700
  const mediaPathMap = newsletter ? NEWSLETTER_MEDIA_PATH_MAP : MEDIA_PATH_MAP
701
- const url = `https://${hostname}${mediaPathMap[mediaType]}/${fileEncSha256B64}?auth=${auth}&token=${fileEncSha256B64}`;
701
+ const serverThumb = newsletter ? '&server_thumb_gen=1' : ''
702
+ const url = `https://${hostname}${mediaPathMap[mediaType]}/${fileEncSha256B64}?auth=${auth}&token=${fileEncSha256B64}${serverThumb}`;
702
703
  let result;
703
704
  try {
704
705
  result = await uploadMedia({
@@ -715,7 +716,8 @@ export const getWAUploadToServer = ({ customUploadHosts, fetchAgent, logger, opt
715
716
  meta_hmac: result.meta_hmac,
716
717
  fbid: result.fbid,
717
718
  ts: result.ts,
718
- handle: result.handle
719
+ thumbnailDirectPath: result.thumbnail_info?.thumbnail_direct_path,
720
+ thumbnailSha256: result.thumbnail_info?.thumbnail_sha256
719
721
  };
720
722
  break;
721
723
  }
@@ -133,7 +133,7 @@ export const prepareWAMessageMedia = async (message, options) => {
133
133
  logger?.info({ key: cacheableKey }, 'Preparing raw media for newsletter');
134
134
  const { filePath, fileSha256, fileLength } = await getRawMediaUploadData(uploadData.media, options.mediaTypeOverride || mediaType, logger);
135
135
  const fileSha256B64 = fileSha256.toString('base64');
136
- const [{ mediaUrl, directPath }] = await Promise.all([
136
+ const [{ mediaUrl, directPath, thumbnailDirectPath, thumbnailSha256 }] = await Promise.all([
137
137
  (async () => {
138
138
  const result = options.upload(filePath, {
139
139
  fileEncSha256B64: fileSha256B64,
@@ -177,6 +177,8 @@ export const prepareWAMessageMedia = async (message, options) => {
177
177
  directPath,
178
178
  fileSha256,
179
179
  fileLength,
180
+ thumbnailDirectPath,
181
+ thumbnailSha256,
180
182
  ...uploadData
181
183
  })
182
184
  });
@@ -1448,7 +1450,7 @@ export const generateWAMessageFromContent = (jid, message, options) => {
1448
1450
  const timestamp = unixTimestampSeconds(options.timestamp);
1449
1451
  const isNewsletter = isJidNewsletter(jid);
1450
1452
  const { quoted, userJid } = options;
1451
- if (quoted) {
1453
+ if (quoted && !isNewsletter) {
1452
1454
  const participant = quoted.key.fromMe
1453
1455
  ? userJid // TODO: Add support for LIDs
1454
1456
  : quoted.participant || quoted.key.participant || quoted.key.remoteJid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itsliaaa/baileys",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "A simple fork of Baileys for WhatsApp automation",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",