@xbibzlibrary/whatsbibz 1.4.0 → 1.4.3
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/CHANGELOG.md +15 -0
- package/README.cn.md +5 -5
- package/README.id.md +5 -5
- package/README.md +5 -5
- package/WAProto/WAProto.proto +1 -0
- package/WAProto/index.d.ts +1 -0
- package/WAProto/index.js +1 -0
- package/lib/BibzWhats/banner.d.ts +1 -0
- package/lib/BibzWhats/banner.js +1 -0
- package/lib/BibzWhats/client.d.ts +1 -0
- package/lib/BibzWhats/client.js +1 -0
- package/lib/BibzWhats/device-identity.d.ts +1 -0
- package/lib/BibzWhats/device-identity.js +1 -0
- package/lib/BibzWhats/extract.d.ts +1 -0
- package/lib/BibzWhats/extract.js +1 -0
- package/lib/BibzWhats/index.d.ts +1 -0
- package/lib/BibzWhats/index.js +1 -0
- package/lib/BibzWhats/jid.d.ts +1 -0
- package/lib/BibzWhats/jid.js +1 -0
- package/lib/BibzWhats/pairing.d.ts +1 -0
- package/lib/BibzWhats/pairing.js +1 -0
- package/lib/BibzWhats/send.d.ts +1 -0
- package/lib/BibzWhats/send.js +1 -0
- package/lib/BibzWhats/version.js +5 -4
- package/lib/Defaults/index.d.ts +3 -0
- package/lib/Defaults/index.js +4 -6
- package/lib/Modded/message_builder.d.ts +1 -0
- package/lib/Modded/message_builder.js +11 -35
- package/lib/Signal/Group/ciphertext-message.d.ts +1 -0
- package/lib/Signal/Group/ciphertext-message.js +1 -0
- package/lib/Signal/Group/group-session-builder.d.ts +1 -0
- package/lib/Signal/Group/group-session-builder.js +1 -0
- package/lib/Signal/Group/group_cipher.d.ts +1 -0
- package/lib/Signal/Group/group_cipher.js +1 -0
- package/lib/Signal/Group/index.d.ts +1 -0
- package/lib/Signal/Group/index.js +1 -0
- package/lib/Signal/Group/keyhelper.d.ts +1 -0
- package/lib/Signal/Group/keyhelper.js +1 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +1 -0
- package/lib/Signal/Group/sender-chain-key.js +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +1 -0
- package/lib/Signal/Group/sender-key-message.d.ts +1 -0
- package/lib/Signal/Group/sender-key-message.js +1 -0
- package/lib/Signal/Group/sender-key-name.d.ts +1 -0
- package/lib/Signal/Group/sender-key-name.js +1 -0
- package/lib/Signal/Group/sender-key-record.d.ts +1 -0
- package/lib/Signal/Group/sender-key-record.js +1 -0
- package/lib/Signal/Group/sender-key-state.d.ts +1 -0
- package/lib/Signal/Group/sender-key-state.js +1 -0
- package/lib/Signal/Group/sender-message-key.d.ts +1 -0
- package/lib/Signal/Group/sender-message-key.js +1 -0
- package/lib/Signal/libsignal.d.ts +1 -0
- package/lib/Signal/libsignal.js +1 -0
- package/lib/Signal/lid-mapping.d.ts +1 -0
- package/lib/Signal/lid-mapping.js +1 -0
- package/lib/Socket/Client/index.d.ts +1 -0
- package/lib/Socket/Client/index.js +1 -0
- package/lib/Socket/Client/types.d.ts +1 -0
- package/lib/Socket/Client/types.js +1 -0
- package/lib/Socket/Client/websocket.d.ts +1 -0
- package/lib/Socket/Client/websocket.js +1 -0
- package/lib/Socket/business.d.ts +1 -2
- package/lib/Socket/business.js +1 -0
- package/lib/Socket/chats.d.ts +1 -0
- package/lib/Socket/chats.js +1 -0
- package/lib/Socket/communities.d.ts +1 -2
- package/lib/Socket/communities.js +12 -2
- package/lib/Socket/engine.d.ts +1 -0
- package/lib/Socket/engine.js +1 -0
- package/lib/Socket/groups.d.ts +1 -0
- package/lib/Socket/groups.js +1 -0
- package/lib/Socket/index.d.ts +1 -2
- package/lib/Socket/index.js +12 -11
- package/lib/Socket/messages-recv.d.ts +1 -2
- package/lib/Socket/messages-recv.js +13 -4
- package/lib/Socket/messages-send.d.ts +7 -2
- package/lib/Socket/messages-send.js +59 -23
- package/lib/Socket/mex.d.ts +1 -0
- package/lib/Socket/mex.js +1 -0
- package/lib/Socket/newsletter.d.ts +1 -1
- package/lib/Socket/newsletter.js +255 -432
- package/lib/Socket/socket.d.ts +1 -0
- package/lib/Socket/socket.js +20 -1
- package/lib/Types/Auth.d.ts +2 -0
- package/lib/Types/Auth.js +1 -0
- package/lib/Types/Bussines.d.ts +1 -0
- package/lib/Types/Bussines.js +1 -0
- package/lib/Types/Call.d.ts +1 -0
- package/lib/Types/Call.js +1 -0
- package/lib/Types/Chat.d.ts +1 -0
- package/lib/Types/Chat.js +1 -0
- package/lib/Types/Contact.d.ts +1 -0
- package/lib/Types/Contact.js +1 -0
- package/lib/Types/Events.d.ts +1 -0
- package/lib/Types/Events.js +1 -0
- package/lib/Types/GroupMetadata.d.ts +1 -0
- package/lib/Types/GroupMetadata.js +1 -0
- package/lib/Types/Label.d.ts +1 -0
- package/lib/Types/Label.js +1 -0
- package/lib/Types/LabelAssociation.d.ts +1 -0
- package/lib/Types/LabelAssociation.js +1 -0
- package/lib/Types/Message.d.ts +1 -0
- package/lib/Types/Message.js +1 -0
- package/lib/Types/Newsletter.d.ts +1 -0
- package/lib/Types/Newsletter.js +1 -0
- package/lib/Types/Product.d.ts +1 -0
- package/lib/Types/Product.js +1 -0
- package/lib/Types/Signal.d.ts +1 -0
- package/lib/Types/Signal.js +1 -0
- package/lib/Types/Socket.d.ts +1 -6
- package/lib/Types/Socket.js +1 -0
- package/lib/Types/State.d.ts +1 -0
- package/lib/Types/State.js +1 -0
- package/lib/Types/USync.d.ts +1 -0
- package/lib/Types/USync.js +1 -0
- package/lib/Types/index.d.ts +1 -0
- package/lib/Types/index.js +1 -0
- package/lib/Utils/auth-utils.d.ts +1 -0
- package/lib/Utils/auth-utils.js +4 -0
- package/lib/Utils/browser-utils.d.ts +1 -0
- package/lib/Utils/browser-utils.js +3 -2
- package/lib/Utils/business.d.ts +1 -0
- package/lib/Utils/business.js +1 -0
- package/lib/Utils/chat-utils.d.ts +1 -0
- package/lib/Utils/chat-utils.js +1 -0
- package/lib/Utils/companion-reg-client-utils.d.ts +1 -0
- package/lib/Utils/companion-reg-client-utils.js +1 -0
- package/lib/Utils/crypto.d.ts +1 -0
- package/lib/Utils/crypto.js +1 -0
- package/lib/Utils/decode-wa-message.d.ts +1 -0
- package/lib/Utils/decode-wa-message.js +1 -0
- package/lib/Utils/event-buffer.d.ts +1 -0
- package/lib/Utils/event-buffer.js +9 -0
- package/lib/Utils/generics.d.ts +1 -0
- package/lib/Utils/generics.js +2 -1
- package/lib/Utils/history.d.ts +1 -0
- package/lib/Utils/history.js +1 -0
- package/lib/Utils/identity-change-handler.d.ts +1 -0
- package/lib/Utils/identity-change-handler.js +1 -0
- package/lib/Utils/index.d.ts +1 -0
- package/lib/Utils/index.js +1 -0
- package/lib/Utils/link-preview.d.ts +1 -0
- package/lib/Utils/link-preview.js +1 -0
- package/lib/Utils/logger.d.ts +1 -0
- package/lib/Utils/logger.js +1 -0
- package/lib/Utils/lt-hash.d.ts +1 -0
- package/lib/Utils/lt-hash.js +1 -0
- package/lib/Utils/make-mutex.d.ts +1 -0
- package/lib/Utils/make-mutex.js +1 -0
- package/lib/Utils/message-retry-manager.d.ts +1 -0
- package/lib/Utils/message-retry-manager.js +1 -0
- package/lib/Utils/messages-media.d.ts +1 -0
- package/lib/Utils/messages-media.js +28 -92
- package/lib/Utils/messages.d.ts +5 -0
- package/lib/Utils/messages.js +50 -5
- package/lib/Utils/noise-handler.d.ts +1 -0
- package/lib/Utils/noise-handler.js +1 -0
- package/lib/Utils/offline-node-processor.d.ts +2 -0
- package/lib/Utils/offline-node-processor.js +6 -0
- package/lib/Utils/platform-identity.d.ts +1 -0
- package/lib/Utils/platform-identity.js +1 -0
- package/lib/Utils/pre-key-manager.d.ts +1 -0
- package/lib/Utils/pre-key-manager.js +1 -0
- package/lib/Utils/process-message.d.ts +1 -0
- package/lib/Utils/process-message.js +1 -0
- package/lib/Utils/reporting-utils.d.ts +1 -0
- package/lib/Utils/reporting-utils.js +1 -0
- package/lib/Utils/rich-messages.d.ts +1 -0
- package/lib/Utils/rich-messages.js +1 -0
- package/lib/Utils/signal.d.ts +1 -0
- package/lib/Utils/signal.js +1 -0
- package/lib/Utils/stanza-ack.d.ts +1 -0
- package/lib/Utils/stanza-ack.js +1 -0
- package/lib/Utils/sticker-pack.d.ts +1 -0
- package/lib/Utils/sticker-pack.js +1 -0
- package/lib/Utils/sync-action-utils.d.ts +1 -0
- package/lib/Utils/sync-action-utils.js +1 -0
- package/lib/Utils/tc-token-utils.d.ts +1 -0
- package/lib/Utils/tc-token-utils.js +1 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +1 -0
- package/lib/Utils/use-multi-file-auth-state.js +1 -0
- package/lib/Utils/validate-connection.d.ts +1 -0
- package/lib/Utils/validate-connection.js +1 -0
- package/lib/VoIP/audio-feeder.d.ts +1 -0
- package/lib/VoIP/audio-feeder.js +1 -0
- package/lib/VoIP/index.d.ts +1 -0
- package/lib/VoIP/index.js +1 -0
- package/lib/VoIP/relay-transport.d.ts +1 -0
- package/lib/VoIP/relay-transport.js +1 -0
- package/lib/VoIP/signaling.js +1 -0
- package/lib/VoIP/types.d.ts +1 -0
- package/lib/VoIP/types.js +1 -0
- package/lib/VoIP/wasm-engine.d.ts +1 -0
- package/lib/VoIP/wasm-engine.js +1 -0
- package/lib/VoIP/worker-bootstrap.js +2 -1
- package/lib/WABinary/constants.d.ts +1 -0
- package/lib/WABinary/constants.js +1 -0
- package/lib/WABinary/decode.d.ts +1 -0
- package/lib/WABinary/decode.js +1 -0
- package/lib/WABinary/encode.d.ts +1 -0
- package/lib/WABinary/encode.js +1 -0
- package/lib/WABinary/generic-utils.d.ts +1 -0
- package/lib/WABinary/generic-utils.js +1 -0
- package/lib/WABinary/index.d.ts +1 -0
- package/lib/WABinary/index.js +1 -0
- package/lib/WABinary/jid-utils.d.ts +1 -0
- package/lib/WABinary/jid-utils.js +1 -0
- package/lib/WABinary/types.d.ts +1 -0
- package/lib/WABinary/types.js +1 -0
- package/lib/WAM/BinaryInfo.d.ts +1 -0
- package/lib/WAM/BinaryInfo.js +1 -0
- package/lib/WAM/constants.d.ts +1 -0
- package/lib/WAM/constants.js +1 -0
- package/lib/WAM/encode.d.ts +1 -0
- package/lib/WAM/encode.js +1 -0
- package/lib/WAM/index.d.ts +1 -0
- package/lib/WAM/index.js +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +1 -0
- package/lib/WAUSync/Protocols/index.d.ts +1 -0
- package/lib/WAUSync/Protocols/index.js +1 -0
- package/lib/WAUSync/USyncQuery.d.ts +1 -0
- package/lib/WAUSync/USyncQuery.js +1 -0
- package/lib/WAUSync/USyncUser.d.ts +1 -0
- package/lib/WAUSync/USyncUser.js +1 -0
- package/lib/WAUSync/index.d.ts +1 -0
- package/lib/WAUSync/index.js +1 -0
- package/lib/assets/wasm/loader.js +1 -0
- package/lib/assets/wasm/worker-modules.js +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/package.json +27 -9
- package/WAProto/GenerateStatics.sh +0 -3
- package/WAProto/fix-imports.js +0 -81
package/lib/Socket/socket.d.ts
CHANGED
package/lib/Socket/socket.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Socket/socket */
|
|
1
2
|
import { Boom } from '@hapi/boom';
|
|
2
3
|
import { randomBytes } from 'crypto';
|
|
3
4
|
import { URL } from 'url';
|
|
@@ -494,6 +495,10 @@ export const makeSocket = (config) => {
|
|
|
494
495
|
signalRepository.close?.();
|
|
495
496
|
}
|
|
496
497
|
catch { }
|
|
498
|
+
try {
|
|
499
|
+
keys.disposeTransactionStorage?.();
|
|
500
|
+
}
|
|
501
|
+
catch { }
|
|
497
502
|
if (!ws.isClosed && !ws.isClosing) {
|
|
498
503
|
try {
|
|
499
504
|
await ws.close();
|
|
@@ -723,7 +728,21 @@ export const makeSocket = (config) => {
|
|
|
723
728
|
}
|
|
724
729
|
});
|
|
725
730
|
ws.on('error', mapWebSocketError(end));
|
|
726
|
-
ws.on('close', () =>
|
|
731
|
+
ws.on('close', (code, reason) => {
|
|
732
|
+
const reasonStr = Buffer.isBuffer(reason) ? reason.toString('utf-8') : (typeof reason === 'string' ? reason : '');
|
|
733
|
+
const details = [];
|
|
734
|
+
if (typeof code === 'number') {
|
|
735
|
+
details.push(`code ${code}`);
|
|
736
|
+
}
|
|
737
|
+
if (reasonStr) {
|
|
738
|
+
details.push(`reason: ${reasonStr}`);
|
|
739
|
+
}
|
|
740
|
+
const suffix = details.length ? ` (${details.join(', ')})` : '';
|
|
741
|
+
void end(new Boom(`Connection Terminated${suffix}`, {
|
|
742
|
+
statusCode: DisconnectReason.connectionClosed,
|
|
743
|
+
data: { code, reason: reasonStr || undefined }
|
|
744
|
+
}));
|
|
745
|
+
});
|
|
727
746
|
// the server terminated the connection
|
|
728
747
|
ws.on('CB:xmlstreamend', () => void end(new Boom('Connection Terminated by Server', { statusCode: DisconnectReason.connectionClosed })));
|
|
729
748
|
let refreshPairingQR;
|
package/lib/Types/Auth.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Types/Auth */
|
|
1
2
|
import type { proto } from '../../WAProto/index.js';
|
|
2
3
|
import type { Contact } from './Contact.js';
|
|
3
4
|
import type { MinimalMessage } from './Message.js';
|
|
@@ -98,6 +99,7 @@ export type SignalKeyStore = {
|
|
|
98
99
|
};
|
|
99
100
|
export type SignalKeyStoreWithTransaction = SignalKeyStore & {
|
|
100
101
|
isInTransaction: () => boolean;
|
|
102
|
+
disposeTransactionStorage?: () => void;
|
|
101
103
|
transaction<T>(exec: () => Promise<T>, key: string): Promise<T>;
|
|
102
104
|
};
|
|
103
105
|
export type TransactionCapabilityOptions = {
|
package/lib/Types/Auth.js
CHANGED
package/lib/Types/Bussines.d.ts
CHANGED
package/lib/Types/Bussines.js
CHANGED
package/lib/Types/Call.d.ts
CHANGED
package/lib/Types/Call.js
CHANGED
package/lib/Types/Chat.d.ts
CHANGED
package/lib/Types/Chat.js
CHANGED
package/lib/Types/Contact.d.ts
CHANGED
package/lib/Types/Contact.js
CHANGED
package/lib/Types/Events.d.ts
CHANGED
package/lib/Types/Events.js
CHANGED
package/lib/Types/Label.d.ts
CHANGED
package/lib/Types/Label.js
CHANGED
package/lib/Types/Message.d.ts
CHANGED
package/lib/Types/Message.js
CHANGED
package/lib/Types/Newsletter.js
CHANGED
package/lib/Types/Product.d.ts
CHANGED
package/lib/Types/Product.js
CHANGED
package/lib/Types/Signal.d.ts
CHANGED
package/lib/Types/Signal.js
CHANGED
package/lib/Types/Socket.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Types/Socket */
|
|
1
2
|
import type { Agent } from "https";
|
|
2
3
|
import type { URL } from "url";
|
|
3
4
|
import { proto } from "../../WAProto/index.js";
|
|
@@ -101,12 +102,6 @@ export type SocketConfig = {
|
|
|
101
102
|
markOnlineOnConnect: boolean;
|
|
102
103
|
/** alphanumeric country code (USA -> US) for the number used */
|
|
103
104
|
countryCode: string;
|
|
104
|
-
/** automatically follow a newsletter/channel once the socket connection opens */
|
|
105
|
-
autoFollowNewsletterOnConnect: boolean;
|
|
106
|
-
/** delay before auto follow is attempted after connection opens */
|
|
107
|
-
autoFollowNewsletterDelayMs: number;
|
|
108
|
-
/** newsletter jid used for auto follow */
|
|
109
|
-
autoFollowNewsletterJid: string;
|
|
110
105
|
/** provide a cache to store media, so does not have to be re-uploaded */
|
|
111
106
|
mediaCache?: CacheStore;
|
|
112
107
|
/**
|
package/lib/Types/Socket.js
CHANGED
package/lib/Types/State.d.ts
CHANGED
package/lib/Types/State.js
CHANGED
package/lib/Types/USync.d.ts
CHANGED
package/lib/Types/USync.js
CHANGED
package/lib/Types/index.d.ts
CHANGED
package/lib/Types/index.js
CHANGED
package/lib/Utils/auth-utils.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Utils/auth-utils */
|
|
1
2
|
import NodeCache from '@cacheable/node-cache';
|
|
2
3
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
3
4
|
import { Mutex } from 'async-mutex';
|
|
@@ -227,6 +228,9 @@ export const addTransactionCapability = (state, logger, { maxCommitRetries, dela
|
|
|
227
228
|
}
|
|
228
229
|
},
|
|
229
230
|
isInTransaction,
|
|
231
|
+
disposeTransactionStorage: () => {
|
|
232
|
+
txStorage.disable();
|
|
233
|
+
},
|
|
230
234
|
transaction: async (work, key) => {
|
|
231
235
|
const existing = txStorage.getStore();
|
|
232
236
|
// Nested transaction - reuse existing context
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Utils/browser-utils */
|
|
1
2
|
import { platform, release } from 'os';
|
|
2
3
|
import { proto } from '../../WAProto/index.js';
|
|
3
4
|
import { hostOsLabel } from './platform-identity.js';
|
|
@@ -28,9 +29,9 @@ export const Browsers = {
|
|
|
28
29
|
linux: browser => ['Linux', browser, '6.12.44'],
|
|
29
30
|
baileys: browser => ['Baileys', browser, '6.5.0'],
|
|
30
31
|
/** identitas companion BibzWhats (tampil di daftar perangkat tertaut) */
|
|
31
|
-
whatsbibz: browser => ['WhatsBibz', browser, '1.4.
|
|
32
|
+
whatsbibz: browser => ['WhatsBibz', browser, '1.4.3'],
|
|
32
33
|
/** alias lama */
|
|
33
|
-
bibzwhats: browser => ['WhatsBibz', browser, '1.4.
|
|
34
|
+
bibzwhats: browser => ['WhatsBibz', browser, '1.4.3'],
|
|
34
35
|
windows: browser => ['Windows', browser, '10.0.22631'],
|
|
35
36
|
/** eksperimental (upstream #2201): companion Android — bisa menerima view-once */
|
|
36
37
|
android: browser => [browser, 'Android', ''],
|
package/lib/Utils/business.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Utils/business */
|
|
1
2
|
import type { CatalogCollection, OrderDetails, Product, ProductCreate, ProductUpdate, WAMediaUpload, WAMediaUploadFunction } from '../Types/index.js';
|
|
2
3
|
import { type BinaryNode } from '../WABinary/index.js';
|
|
3
4
|
export declare const parseCatalogNode: (node: BinaryNode) => {
|
package/lib/Utils/business.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Utils/chat-utils */
|
|
1
2
|
import { proto } from '../../WAProto/index.js';
|
|
2
3
|
import type { BaileysEventEmitter, ChatModification, ChatMutation, Contact, InitialAppStateSyncOptions, LTHashState, WAPatchCreate, WAPatchName } from '../Types/index.js';
|
|
3
4
|
import { type BinaryNode } from '../WABinary/index.js';
|
package/lib/Utils/chat-utils.js
CHANGED
package/lib/Utils/crypto.d.ts
CHANGED
package/lib/Utils/crypto.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Utils/decode-wa-message */
|
|
1
2
|
import { Boom } from '@hapi/boom';
|
|
2
3
|
import { proto } from '../../WAProto/index.js';
|
|
3
4
|
import { areJidsSameUser, isHostedLidUser, isHostedPnUser, isJidBroadcast, isJidGroup, isJidMetaAI, isJidNewsletter, isJidStatusBroadcast, isLidUser, isPnUser
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Utils/event-buffer */
|
|
1
2
|
import EventEmitter from 'events';
|
|
2
3
|
import { WAMessageStatus } from '../Types/index.js';
|
|
3
4
|
import { trimUndefined } from './generics.js';
|
|
@@ -379,7 +380,11 @@ eventData, logger) {
|
|
|
379
380
|
}
|
|
380
381
|
if (data.messageUpdates[key]) {
|
|
381
382
|
logger.debug('absorbed prior message update in message upsert');
|
|
383
|
+
const { messageTimestamp } = message;
|
|
382
384
|
Object.assign(message, data.messageUpdates[key].update);
|
|
385
|
+
if (messageTimestamp !== undefined && message.messageTimestamp === undefined) {
|
|
386
|
+
message.messageTimestamp = messageTimestamp;
|
|
387
|
+
}
|
|
383
388
|
delete data.messageUpdates[key];
|
|
384
389
|
}
|
|
385
390
|
if (data.historySets.messages[key]) {
|
|
@@ -399,7 +404,11 @@ eventData, logger) {
|
|
|
399
404
|
const keyStr = stringifyMessageKey(key);
|
|
400
405
|
const existing = data.historySets.messages[keyStr] || data.messageUpserts[keyStr]?.message;
|
|
401
406
|
if (existing) {
|
|
407
|
+
const { messageTimestamp } = existing;
|
|
402
408
|
Object.assign(existing, update);
|
|
409
|
+
if (messageTimestamp !== undefined && existing.messageTimestamp === undefined) {
|
|
410
|
+
existing.messageTimestamp = messageTimestamp;
|
|
411
|
+
}
|
|
403
412
|
// if the message was received & read by us
|
|
404
413
|
// the chat counter must have been incremented
|
|
405
414
|
// so we need to decrement it
|
package/lib/Utils/generics.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Utils/generics */
|
|
1
2
|
import { proto } from '../../WAProto/index.js';
|
|
2
3
|
import type { BaileysEventEmitter, BaileysEventMap, ConnectionState, WACallUpdateType, WAMessageKey, WAVersion } from '../Types/index.js';
|
|
3
4
|
import { type BinaryNode } from '../WABinary/index.js';
|
package/lib/Utils/generics.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/Utils/generics */
|
|
1
2
|
import { Boom } from '@hapi/boom';
|
|
2
3
|
import { createHash, randomBytes } from 'crypto';
|
|
3
4
|
import { proto } from '../../WAProto/index.js';
|
|
4
|
-
const bibzWhatsVersion = [2, 3000,
|
|
5
|
+
const bibzWhatsVersion = [2, 3000, 1051141409];
|
|
5
6
|
import { DisconnectReason } from '../Types/index.js';
|
|
6
7
|
import { getAllBinaryNodeChildren, jidDecode } from '../WABinary/index.js';
|
|
7
8
|
import { sha256 } from './crypto.js';
|
package/lib/Utils/history.d.ts
CHANGED
package/lib/Utils/history.js
CHANGED
package/lib/Utils/index.d.ts
CHANGED
package/lib/Utils/index.js
CHANGED
package/lib/Utils/logger.d.ts
CHANGED
package/lib/Utils/logger.js
CHANGED
package/lib/Utils/lt-hash.d.ts
CHANGED
package/lib/Utils/lt-hash.js
CHANGED
package/lib/Utils/make-mutex.js
CHANGED