plogme 2.1.1 → 2.1.2
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 +115 -0
- package/WAProto/WAProto.proto +12 -0
- package/WAProto/index.d.ts +12 -0
- package/WAProto/index.js +12 -0
- package/engine-requirements.js +12 -0
- package/lib/Defaults/ban-checker.js +12 -0
- package/lib/Defaults/index.js +12 -0
- package/lib/Signal/Group/ciphertext-message.js +12 -0
- package/lib/Signal/Group/group-session-builder.js +12 -0
- package/lib/Signal/Group/group_cipher.js +12 -0
- package/lib/Signal/Group/index.js +12 -0
- package/lib/Signal/Group/keyhelper.js +12 -0
- package/lib/Signal/Group/sender-chain-key.js +12 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +12 -0
- package/lib/Signal/Group/sender-key-message.js +12 -0
- package/lib/Signal/Group/sender-key-name.js +12 -0
- package/lib/Signal/Group/sender-key-record.js +12 -0
- package/lib/Signal/Group/sender-key-state.js +12 -0
- package/lib/Signal/Group/sender-message-key.js +12 -0
- package/lib/Signal/libsignal.js +12 -0
- package/lib/Signal/lid-mapping.js +12 -0
- package/lib/Socket/Client/index.js +12 -0
- package/lib/Socket/Client/types.js +12 -0
- package/lib/Socket/Client/websocket.js +12 -0
- package/lib/Socket/aigroups.js +12 -0
- package/lib/Socket/ban-checker.js +12 -0
- package/lib/Socket/business.js +12 -0
- package/lib/Socket/chats.js +12 -0
- package/lib/Socket/communities.js +12 -0
- package/lib/Socket/graphql.js +12 -0
- package/lib/Socket/groups.js +12 -0
- package/lib/Socket/index.js +12 -0
- package/lib/Socket/interactive-handler.js +12 -0
- package/lib/Socket/interop.js +12 -0
- package/lib/Socket/managed-account.js +12 -0
- package/lib/Socket/messages-recv.js +12 -0
- package/lib/Socket/messages-send.js +307 -6
- package/lib/Socket/mex.js +12 -0
- package/lib/Socket/newsletter.js +12 -0
- package/lib/Socket/privacy.js +12 -0
- package/lib/Socket/registration.js +12 -0
- package/lib/Socket/socket.js +12 -0
- package/lib/Socket/username.js +12 -0
- package/lib/Store/index.js +12 -0
- package/lib/Store/make-cache-manager-store.js +12 -0
- package/lib/Store/make-in-memory-store.js +12 -0
- package/lib/Store/make-ordered-dictionary.js +12 -0
- package/lib/Store/object-repository.js +12 -0
- package/lib/Types/Auth.js +12 -0
- package/lib/Types/Bussines.js +12 -0
- package/lib/Types/Call.js +12 -0
- package/lib/Types/Chat.js +12 -0
- package/lib/Types/Contact.js +12 -0
- package/lib/Types/Events.js +12 -0
- package/lib/Types/GroupMetadata.js +12 -0
- package/lib/Types/Label.js +12 -0
- package/lib/Types/LabelAssociation.js +12 -0
- package/lib/Types/Message.js +12 -0
- package/lib/Types/Mex.js +12 -0
- package/lib/Types/Product.js +12 -0
- package/lib/Types/RichType.js +12 -0
- package/lib/Types/Signal.js +12 -0
- package/lib/Types/Socket.js +12 -0
- package/lib/Types/State.js +12 -0
- package/lib/Types/USync.js +12 -0
- package/lib/Types/index.js +12 -0
- package/lib/Utils/auth-utils.js +12 -0
- package/lib/Utils/bot-capabilities.js +12 -0
- package/lib/Utils/bot-planning-replay.js +12 -0
- package/lib/Utils/browser-utils.js +12 -0
- package/lib/Utils/business.js +12 -0
- package/lib/Utils/channel-policy.js +12 -0
- package/lib/Utils/chat-utils.js +12 -0
- package/lib/Utils/companion-reg-client-utils.js +12 -0
- package/lib/Utils/consumer-application.js +12 -0
- package/lib/Utils/crypto.js +12 -0
- package/lib/Utils/decode-wa-message.js +12 -0
- package/lib/Utils/event-buffer.js +12 -0
- package/lib/Utils/games/miniapp.js +12 -0
- package/lib/Utils/games/slot-machine.js +12 -0
- package/lib/Utils/games/website-preview.js +12 -0
- package/lib/Utils/generics.js +12 -0
- package/lib/Utils/group-history.js +12 -0
- package/lib/Utils/history.js +12 -0
- package/lib/Utils/identity-change-handler.js +12 -0
- package/lib/Utils/index.js +12 -0
- package/lib/Utils/jid-display-normalization.js +12 -0
- package/lib/Utils/link-preview.js +12 -0
- package/lib/Utils/logger.js +12 -0
- package/lib/Utils/lt-hash.js +12 -0
- package/lib/Utils/make-mutex.js +12 -0
- package/lib/Utils/message-composer.js +18 -1
- package/lib/Utils/message-inspect.js +12 -0
- package/lib/Utils/message-retry-manager.js +12 -0
- package/lib/Utils/messages-media.js +12 -0
- package/lib/Utils/messages.js +77 -4
- package/lib/Utils/meta-ai-msmsg.js +12 -0
- package/lib/Utils/meta-compositing.js +12 -0
- package/lib/Utils/native-flow.js +12 -0
- package/lib/Utils/noise-handler.js +12 -0
- package/lib/Utils/offline-node-processor.js +12 -0
- package/lib/Utils/pre-key-manager.js +12 -0
- package/lib/Utils/process-message.js +12 -0
- package/lib/Utils/reporting-utils.js +12 -0
- package/lib/Utils/rich-message-utils.js +290 -9
- package/lib/Utils/signal.js +12 -0
- package/lib/Utils/source-grep.js +12 -0
- package/lib/Utils/stanza-ack.js +12 -0
- package/lib/Utils/sync-action-utils.js +12 -0
- package/lib/Utils/tc-token-utils.js +12 -0
- package/lib/Utils/use-multi-file-auth-state.js +12 -0
- package/lib/Utils/use-single-file-auth-state.js +12 -0
- package/lib/Utils/use-sqlite-auth-state.js +12 -0
- package/lib/Utils/validate-connection.js +12 -0
- package/lib/Utils/view-once-utils.js +12 -0
- package/lib/Utils/voip-rekey.js +12 -0
- package/lib/Utils/welcome-flow.js +12 -0
- package/lib/WABinary/constants.js +12 -0
- package/lib/WABinary/decode.js +12 -0
- package/lib/WABinary/encode.js +12 -0
- package/lib/WABinary/generic-utils.js +12 -0
- package/lib/WABinary/index.js +12 -0
- package/lib/WABinary/jid-utils.js +12 -0
- package/lib/WABinary/types.js +12 -0
- package/lib/WAM/BinaryInfo.js +12 -0
- package/lib/WAM/constants.js +12 -0
- package/lib/WAM/encode.js +12 -0
- package/lib/WAM/index.js +12 -0
- package/lib/WAUSync/Protocols/USyncBusinessProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncFeatureProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncPictureProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncSidelistProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncTextStatusProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +12 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +12 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +12 -0
- package/lib/WAUSync/Protocols/index.js +12 -0
- package/lib/WAUSync/USyncQuery.js +12 -0
- package/lib/WAUSync/USyncUser.js +12 -0
- package/lib/WAUSync/index.js +12 -0
- package/lib/index.d.ts +46 -2
- package/lib/index.js +12 -0
- package/package.json +9 -2
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/link-preview.js
|
|
5
|
+
* About: Link preview module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: getUrlInfo
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { prepareWAMessageMedia } from './messages.js';
|
|
2
14
|
import { extractImageThumb, getHttpStream } from './messages-media.js';
|
|
3
15
|
const THUMBNAIL_WIDTH_PX = 192;
|
package/lib/Utils/logger.js
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/logger.js
|
|
5
|
+
* About: Logger module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: No public exports detected; module side effects or declarations are local.
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import P from 'pino';
|
|
2
14
|
export default P({ timestamp: () => `,"time":"${new Date().toJSON()}"` });
|
package/lib/Utils/lt-hash.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/lt-hash.js
|
|
5
|
+
* About: Lt hash module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: LT_HASH_ANTI_TAMPERING
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { LTHashAntiTampering } from 'whatsapp-rust-bridge';
|
|
2
14
|
/**
|
|
3
15
|
* LT Hash is a summation based hash algorithm that maintains the integrity of a piece of data
|
package/lib/Utils/make-mutex.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/make-mutex.js
|
|
5
|
+
* About: Make mutex module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: makeMutex, makeKeyedMutex
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { Mutex as AsyncMutex } from 'async-mutex';
|
|
2
14
|
export const makeMutex = () => {
|
|
3
15
|
const mutex = new AsyncMutex();
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/message-composer.js
|
|
5
|
+
* About: Message composer module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: generateTableContent, generateListContent, generateCodeBlockContent, generateLatexContent, generateLatexImageContent, generateLatexInlineImageContent, captureUnifiedResponse, generateUnifiedResponseContent; …
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { proto } from '../../WAProto/index.js';
|
|
2
14
|
import { generateMessageIDV2 } from './generics.js';
|
|
3
15
|
|
|
@@ -265,7 +277,12 @@ const buildBotForwardedMessage = (submessages, contextInfo, unifiedResponse) =>
|
|
|
265
277
|
|
|
266
278
|
export const generateTableContent = (title, headers, rows, quoted, options = {}) => {
|
|
267
279
|
const { footer, headerText } = options;
|
|
268
|
-
const
|
|
280
|
+
const safeHeaders = Array.isArray(headers) ? headers.map(String) : [];
|
|
281
|
+
const safeRows = Array.isArray(rows) ? rows : [];
|
|
282
|
+
const tableRows = [
|
|
283
|
+
{ items: safeHeaders, isHeading: true },
|
|
284
|
+
...safeRows.map(row => ({ items: Array.isArray(row) ? row.map(String) : [String(row)] }))
|
|
285
|
+
];
|
|
269
286
|
const submessages = [];
|
|
270
287
|
if (headerText) {
|
|
271
288
|
submessages.push({ messageType: 2, messageText: headerText });
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/message-inspect.js
|
|
5
|
+
* About: Message inspect module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: isScheduledMessage, getScheduledMessageTime, getMessagePaymentInfo, getMessageCommentMetadata, getMessageAddOns, getPollCorrectAnswer, toJid, getSenderLid
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { proto } from '../../WAProto/index.js';
|
|
2
14
|
import { isLidUser, jidEncode } from '../WABinary/index.js';
|
|
3
15
|
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/message-retry-manager.js
|
|
5
|
+
* About: Message retry manager module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: RetryReason, MessageRetryManager
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { LRUCache } from 'lru-cache';
|
|
2
14
|
/** Number of sent messages to cache in memory for handling retry receipts */
|
|
3
15
|
const RECENT_MESSAGES_SIZE = 1024;
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/messages-media.js
|
|
5
|
+
* About: Messages media module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: getImageProcessingLibrary, hkdfInfoKey, getRawMediaUploadData, getMediaKeys, extractVideoThumb, extractImageThumb, encodeBase64EncodedStringForUpload, generateProfilePicture; …
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { Boom } from '@hapi/boom';
|
|
2
14
|
import { spawn } from 'child_process';
|
|
3
15
|
import * as Crypto from 'crypto';
|
package/lib/Utils/messages.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/messages.js
|
|
5
|
+
* About: Messages module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: extractUrlFromText, generateLinkPreviewIfRequired, prepareWAMessageMedia, prepareDisappearingMessageSettingContent, generateForwardMessageContent, hasNonNullishProperty, hasOptionalProperty, hasValidAlbumMedia; …
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { Boom } from '@hapi/boom';
|
|
2
14
|
import { randomBytes } from 'crypto';
|
|
3
15
|
import { zip } from 'fflate';
|
|
@@ -93,7 +105,7 @@ export const prepareWAMessageMedia = async (message, options) => {
|
|
|
93
105
|
uploadData.mimetype = MIMETYPE_MAP[mediaType];
|
|
94
106
|
}
|
|
95
107
|
if (mediaType === 'sticker') {
|
|
96
|
-
//
|
|
108
|
+
// New compatibility names the native AI-sticker marker `meta`. WhatsApp's
|
|
97
109
|
// current StickerMessage schema exposes this as `isAiSticker`.
|
|
98
110
|
if (hasOptionalProperty(message, 'meta')) {
|
|
99
111
|
uploadData.isAiSticker = !!message.meta;
|
|
@@ -1432,7 +1444,7 @@ export const generateWAMessageContent = async (message, options) => {
|
|
|
1432
1444
|
throw new Boom('Invalid media type for carousel card', { statusCode: 400 });
|
|
1433
1445
|
}
|
|
1434
1446
|
const carouselCard = {
|
|
1435
|
-
nativeFlowMessage: prepareNativeFlowButtons({
|
|
1447
|
+
nativeFlowMessage: card.nativeFlowMessage || prepareNativeFlowButtons({
|
|
1436
1448
|
...card,
|
|
1437
1449
|
nativeFlow: card.nativeFlow || card.buttons || []
|
|
1438
1450
|
}),
|
|
@@ -1471,8 +1483,8 @@ export const generateWAMessageContent = async (message, options) => {
|
|
|
1471
1483
|
messageVersion: 1
|
|
1472
1484
|
}
|
|
1473
1485
|
};
|
|
1474
|
-
if (hasOptionalProperty(message, 'text')) {
|
|
1475
|
-
interactiveMessage.body = { text: message.text };
|
|
1486
|
+
if (hasOptionalProperty(message, 'text') || hasOptionalProperty(message, 'content')) {
|
|
1487
|
+
interactiveMessage.body = { text: message.text ?? message.content };
|
|
1476
1488
|
}
|
|
1477
1489
|
if (hasOptionalProperty(message, 'footer')) {
|
|
1478
1490
|
interactiveMessage.footer = { text: message.footer };
|
|
@@ -1945,6 +1957,67 @@ export const generateWAMessageFromImagePoll = async (jid, content, relay, option
|
|
|
1945
1957
|
}
|
|
1946
1958
|
return poll;
|
|
1947
1959
|
};
|
|
1960
|
+
/**
|
|
1961
|
+
* Sends a motion photo as an image parent followed by an associated video child.
|
|
1962
|
+
* The static image may be supplied as `image` or `thumbnail`; otherwise the
|
|
1963
|
+
* prepared video thumbnail is used as the still image.
|
|
1964
|
+
*/
|
|
1965
|
+
export const generateWAMessageFromLivePhoto = async (jid, content, relay, options = {}) => {
|
|
1966
|
+
if (typeof relay !== 'function') {
|
|
1967
|
+
throw new Boom('live photo requires a relay callback', { statusCode: 400 });
|
|
1968
|
+
}
|
|
1969
|
+
if (!content?.video) {
|
|
1970
|
+
throw new Boom('live photo requires a video source', { statusCode: 400 });
|
|
1971
|
+
}
|
|
1972
|
+
const normalizeMedia = media => typeof media === 'string' ? { url: media } : media;
|
|
1973
|
+
const offset = content.motionPhotoPresentationOffsetMs ?? content.presentationOffsetMs;
|
|
1974
|
+
if (offset != null && (!Number.isSafeInteger(Number(offset)) || Number(offset) < 0)) {
|
|
1975
|
+
throw new Boom('motionPhotoPresentationOffsetMs must be a non-negative integer', { statusCode: 400 });
|
|
1976
|
+
}
|
|
1977
|
+
const video = await prepareWAMessageMedia({
|
|
1978
|
+
video: normalizeMedia(content.video),
|
|
1979
|
+
...(content.videoMimetype ? { mimetype: content.videoMimetype } : {}),
|
|
1980
|
+
...(content.videoThumbnail ? { jpegThumbnail: content.videoThumbnail } : {}),
|
|
1981
|
+
...(offset != null ? { motionPhotoPresentationOffsetMs: Number(offset) } : {})
|
|
1982
|
+
}, { ...options, jid });
|
|
1983
|
+
const videoMessage = video?.videoMessage;
|
|
1984
|
+
if (!videoMessage) {
|
|
1985
|
+
throw new Boom('live photo video could not be prepared', { statusCode: 400 });
|
|
1986
|
+
}
|
|
1987
|
+
const still = content.image || content.thumbnail || videoMessage.jpegThumbnail;
|
|
1988
|
+
if (!still) {
|
|
1989
|
+
throw new Boom('live photo needs a still image or a video with an extractable thumbnail', { statusCode: 400 });
|
|
1990
|
+
}
|
|
1991
|
+
const parent = await generateWAMessage(jid, {
|
|
1992
|
+
image: normalizeMedia(still),
|
|
1993
|
+
caption: content.caption ?? content.text ?? '',
|
|
1994
|
+
...(!content.image && !content.thumbnail && videoMessage.jpegThumbnail
|
|
1995
|
+
? { jpegThumbnail: videoMessage.jpegThumbnail }
|
|
1996
|
+
: content.imageThumbnail ? { jpegThumbnail: content.imageThumbnail } : {})
|
|
1997
|
+
}, { ...options, jid });
|
|
1998
|
+
const childContent = proto.Message.fromObject({
|
|
1999
|
+
videoMessage: {
|
|
2000
|
+
...videoMessage,
|
|
2001
|
+
...(offset != null ? { motionPhotoPresentationOffsetMs: Number(offset) } : {})
|
|
2002
|
+
},
|
|
2003
|
+
messageContextInfo: {
|
|
2004
|
+
messageAssociation: {
|
|
2005
|
+
associationType: proto.MessageAssociation.AssociationType.MOTION_PHOTO,
|
|
2006
|
+
parentMessageKey: parent.key
|
|
2007
|
+
}
|
|
2008
|
+
}
|
|
2009
|
+
});
|
|
2010
|
+
const { quoted: _quoted, ...childOptions } = options;
|
|
2011
|
+
const child = generateWAMessageFromContent(jid, childContent, {
|
|
2012
|
+
...childOptions,
|
|
2013
|
+
jid,
|
|
2014
|
+
messageId: undefined
|
|
2015
|
+
});
|
|
2016
|
+
const relayOptions = options.relayOptions || {};
|
|
2017
|
+
await relay(parent.message, { ...relayOptions, messageId: parent.key.id }, parent);
|
|
2018
|
+
await relay(child.message, { ...relayOptions, messageId: child.key.id }, child);
|
|
2019
|
+
return parent;
|
|
2020
|
+
};
|
|
1948
2021
|
/** Get the key to access the true type of content */
|
|
1949
2022
|
export const getContentType = (content) => {
|
|
1950
2023
|
if (content) {
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/meta-ai-msmsg.js
|
|
5
|
+
* About: Meta ai msmsg module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: decryptMsmsgBotMessage, parseUnifiedResponseData, textFromUnifiedResponse, textFromRichResponse, extractMetaAiText, decodeUnifiedResponseInPlace, decodeDecryptedMsmsgMessage
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { proto } from '../../WAProto/index.js';
|
|
2
14
|
import { aesDecryptGCM, hkdf } from './crypto.js';
|
|
3
15
|
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/meta-compositing.js
|
|
5
|
+
* About: Meta compositing module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: PlanningStepStatus, supportsMetaRendering, buildProgressIndicator, buildCompositingPlaceholder, buildPlainPlaceholder, metaTyping, editMetaMessage, sendMetaComposited; …
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
/**
|
|
2
14
|
* Lia@Changes [WIP]
|
|
3
15
|
* Meta Compositing — send rich messages with Meta AI-style progress indicator.
|
package/lib/Utils/native-flow.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/native-flow.js
|
|
5
|
+
* About: Native flow module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: parseNativeFlowResponse, parseWhatsAppFlowResponse, buildWhatsAppFlowButton, makeWhatsAppFlowButton
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
const parseJsonObject = (value) => {
|
|
2
14
|
if (!value) {
|
|
3
15
|
return {};
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/noise-handler.js
|
|
5
|
+
* About: Noise handler module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: makeNoiseHandler
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { Boom } from '@hapi/boom';
|
|
2
14
|
import { proto } from '../../WAProto/index.js';
|
|
3
15
|
import { NOISE_MODE, WA_CERT_DETAILS } from '../Defaults/index.js';
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/offline-node-processor.js
|
|
5
|
+
* About: Offline node processor module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: makeOfflineNodeProcessor
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
/**
|
|
2
14
|
* Creates a processor for offline stanza nodes that:
|
|
3
15
|
* - Queues nodes for sequential processing
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/pre-key-manager.js
|
|
5
|
+
* About: Pre key manager module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: PreKeyManager
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import PQueue from 'p-queue';
|
|
2
14
|
/**
|
|
3
15
|
* Manages pre-key operations with proper concurrency control
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/process-message.js
|
|
5
|
+
* About: Process message module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: cleanMessage, isRealMessage, shouldIncrementChatUnread, getChatId, decryptPollVote, decryptEventResponse
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { proto } from '../../WAProto/index.js';
|
|
2
14
|
import { WAMessageStubType } from '../Types/index.js';
|
|
3
15
|
import { getContentType, normalizeMessageContent } from '../Utils/messages.js';
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/reporting-utils.js
|
|
5
|
+
* About: Reporting utils module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: shouldIncludeReportingToken, getMessageReportingToken
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { createHmac } from 'crypto';
|
|
2
14
|
import { proto } from '../../WAProto/index.js';
|
|
3
15
|
import { hkdf } from './crypto.js';
|