lordceaser-baileys 3.4.8 → 3.4.10

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.
@@ -299,7 +299,22 @@ export const makeChatsSocket = (config) => {
299
299
  const listNode = getBinaryNodeChild(result, 'list');
300
300
  return getBinaryNodeChildren(listNode, 'item').map(n => n.attrs.jid);
301
301
  };
302
- const updateBlockStatus = async (jid, action) => {
302
+ const reportJid = async (jid) => {
303
+ const target = jidNormalizedUser(jid);
304
+ let lastErr;
305
+ for (const flow of ['account_info_report', 'contact_info']) {
306
+ try {
307
+ await query({
308
+ tag: 'iq',
309
+ attrs: { to: S_WHATSAPP_NET, xmlns: 'spam', type: 'set' },
310
+ content: [{ tag: 'spam_list', attrs: { jid: target, spam_flow: flow } }]
311
+ });
312
+ return true;
313
+ } catch (e) { lastErr = e; }
314
+ }
315
+ throw lastErr;
316
+ };
317
+ const updateBlockStatus = async (jid, action) => {
303
318
  const normalizedJid = jidNormalizedUser(jid);
304
319
  let lid;
305
320
  let pn_jid;
@@ -1189,6 +1204,7 @@ export const makeChatsSocket = (config) => {
1189
1204
  updateProfileStatus,
1190
1205
  updateProfileName,
1191
1206
  updateBlockStatus,
1207
+ reportJid,
1192
1208
  updateDisableLinkPreviewsPrivacy,
1193
1209
  updateCallPrivacy,
1194
1210
  updateMessagesPrivacy,
@@ -482,7 +482,19 @@ export const makeMessagesSocket = (config) => {
482
482
  const patched = patchMessageBeforeSending ? await patchMessageBeforeSending(message, []) : message;
483
483
  const bytes = encodeNewsletterMessage(patched);
484
484
  // Lia@Changes 08-02-26 --- Add "additionalNodes" for newsletter too (⁠っ⁠˘̩⁠╭⁠╮⁠˘̩⁠)⁠っ
485
- if (additionalNodes && additionalNodes.length > 0) {
485
+ /* CEASER-CAROUSEL-PATCH */
486
+ try{
487
+ const __m=message&&(message.viewOnceMessage?.message||message.viewOnceMessageV2?.message||message.viewOnceMessageV2Extension?.message||message.documentWithCaptionMessage?.message||message);
488
+ const __im=__m&&__m.interactiveMessage;
489
+ if(__im&&__im.carouselMessage){
490
+ const __has=(Array.isArray(stanza.content)&&stanza.content.some(n=>n&&n.tag==='biz'))||(Array.isArray(additionalNodes)&&additionalNodes.some(n=>n&&n.tag==='biz'));
491
+ if(!__has){
492
+ if(!Array.isArray(stanza.content))stanza.content=[];
493
+ stanza.content.push({tag:'biz',attrs:{},content:[{tag:'interactive',attrs:{type:'native_flow',v:'1'},content:[{tag:'native_flow',attrs:{v:'9',name:'mixed'}}]}]});
494
+ }
495
+ }
496
+ }catch(e){}
497
+ if (additionalNodes && additionalNodes.length > 0) {
486
498
  ;
487
499
  binaryNodeContent.push(...additionalNodes);
488
500
  }