sanka-baileyss 2.3.2 → 2.3.4
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/BotMetadata/BotMetadata.d.ts +594 -1
- package/WAProto/BotMetadata/BotMetadata.js +1910 -148
- package/WAProto/BotMetadata/BotMetadata.proto +36 -0
- package/WAProto/E2E/E2E.d.ts +570 -6
- package/WAProto/E2E/E2E.js +1591 -26
- package/WAProto/E2E/E2E.proto +10 -1
- package/WAProto/HistorySync/HistorySync.d.ts +806 -6
- package/WAProto/HistorySync/HistorySync.js +2193 -29
- package/WAProto/HistorySync/HistorySync.proto +2 -1
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.d.ts +570 -6
- package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +1591 -26
- package/WAProto/StatusAttributions/StatusAttributions.d.ts +2 -1
- package/WAProto/StatusAttributions/StatusAttributions.js +7 -0
- package/WAProto/StatusAttributions/StatusAttributions.proto +1 -0
- package/WAProto/SyncAction/SyncAction.d.ts +230 -0
- package/WAProto/SyncAction/SyncAction.js +578 -2
- package/WAProto/SyncAction/SyncAction.proto +13 -1
- package/WAProto/Web/Web.d.ts +570 -6
- package/WAProto/Web/Web.js +1591 -26
- package/lib/Defaults/baileys-version.json +2 -2
- package/lib/Defaults/index.d.ts +42 -25
- package/lib/Defaults/index.js +6 -2
- package/lib/Signal/Group/sender-key-record.js +23 -28
- package/lib/Signal/libsignal.d.ts +1 -0
- package/lib/Socket/Client/index.js +13 -9
- package/lib/Socket/Client/types.d.ts +11 -10
- package/lib/Socket/Client/types.js +11 -7
- package/lib/Socket/Client/websocket.d.ts +9 -8
- package/lib/Socket/Client/websocket.js +52 -47
- package/lib/Socket/business.d.ts +185 -182
- package/lib/Socket/business.js +258 -249
- package/lib/Socket/chats.d.ts +90 -87
- package/lib/Socket/chats.js +1095 -888
- package/lib/Socket/community.d.ts +131 -0
- package/lib/Socket/community.js +369 -0
- package/lib/Socket/groups.d.ts +50 -41
- package/lib/Socket/groups.js +10 -3
- package/lib/Socket/index.d.ts +5 -1
- package/lib/Socket/index.js +19 -5
- package/lib/Socket/messages-recv.d.ts +6 -2
- package/lib/Socket/messages-recv.js +31 -8
- package/lib/Socket/messages-send.d.ts +5 -1
- package/lib/Socket/messages-send.js +1293 -1351
- package/lib/Socket/newsletter.d.ts +142 -135
- package/lib/Socket/newsletter.js +274 -230
- package/lib/Socket/socket.d.ts +37 -35
- package/lib/Socket/usync.d.ts +31 -30
- package/lib/Socket/usync.js +74 -62
- package/lib/Types/Auth.d.ts +89 -72
- package/lib/Types/Auth.js +1 -0
- package/lib/Types/Call.d.ts +11 -10
- package/lib/Types/Call.js +1 -0
- package/lib/Types/Chat.d.ts +85 -62
- package/lib/Types/Chat.js +4 -1
- package/lib/Types/Contact.js +1 -0
- package/lib/Types/Events.d.ts +209 -191
- package/lib/Types/Events.js +1 -0
- package/lib/Types/GroupMetadata.d.ts +12 -27
- package/lib/Types/GroupMetadata.js +1 -0
- package/lib/Types/Label.d.ts +41 -39
- package/lib/Types/Label.js +24 -21
- package/lib/Types/LabelAssociation.d.ts +18 -12
- package/lib/Types/LabelAssociation.js +6 -3
- package/lib/Types/Message.d.ts +3 -2
- package/lib/Types/Message.js +7 -3
- package/lib/Types/MexUpdates.d.ts +9 -0
- package/lib/Types/MexUpdates.js +18 -0
- package/lib/Types/Newsletter.d.ts +84 -67
- package/lib/Types/Newsletter.js +30 -23
- package/lib/Types/Product.d.ts +70 -56
- package/lib/Types/Product.js +1 -0
- package/lib/Types/Signal.d.ts +46 -35
- package/lib/Types/Signal.js +1 -0
- package/lib/Types/Socket.d.ts +105 -101
- package/lib/Types/Socket.js +1 -0
- package/lib/Types/State.d.ts +37 -23
- package/lib/Types/State.js +13 -1
- package/lib/Types/USync.d.ts +21 -20
- package/lib/Types/USync.js +1 -0
- package/lib/Types/index.d.ts +51 -42
- package/lib/Types/index.js +25 -19
- package/lib/Utils/auth-utils.d.ts +14 -11
- package/lib/Utils/auth-utils.js +189 -182
- package/lib/Utils/baileys-event-stream.d.ts +12 -10
- package/lib/Utils/baileys-event-stream.js +52 -46
- package/lib/Utils/business.d.ts +15 -8
- package/lib/Utils/business.js +229 -217
- package/lib/Utils/chat-utils.d.ts +22 -12
- package/lib/Utils/chat-utils.js +57 -27
- package/lib/Utils/crypto.d.ts +31 -15
- package/lib/Utils/crypto.js +136 -107
- package/lib/Utils/decode-wa-message.d.ts +34 -245
- package/lib/Utils/decode-wa-message.js +205 -217
- package/lib/Utils/event-buffer.d.ts +30 -26
- package/lib/Utils/event-buffer.js +519 -515
- package/lib/Utils/history.d.ts +2 -8
- package/lib/Utils/index.js +13 -9
- package/lib/Utils/link-preview.d.ts +16 -14
- package/lib/Utils/link-preview.js +100 -92
- package/lib/Utils/logger.d.ts +9 -7
- package/lib/Utils/logger.js +1 -1
- package/lib/Utils/lt-hash.d.ts +10 -8
- package/lib/Utils/lt-hash.js +49 -44
- package/lib/Utils/make-mutex.d.ts +4 -2
- package/lib/Utils/make-mutex.js +43 -39
- package/lib/Utils/messages-media.d.ts +75 -50
- package/lib/Utils/messages.d.ts +60 -35
- package/lib/Utils/messages.js +87 -8
- package/lib/Utils/noise-handler.d.ts +13 -12
- package/lib/Utils/noise-handler.js +143 -138
- package/lib/Utils/process-message.d.ts +32 -24
- package/lib/Utils/process-message.js +387 -367
- package/lib/Utils/signal.d.ts +24 -15
- package/lib/Utils/signal.js +143 -131
- package/lib/Utils/use-mongo-file-auth-state.d.ts +3 -2
- package/lib/Utils/use-mongo-file-auth-state.js +72 -63
- package/lib/Utils/use-multi-file-auth-state.d.ts +9 -8
- package/lib/Utils/use-multi-file-auth-state.js +110 -102
- package/lib/Utils/use-single-file-auth-state.d.ts +8 -7
- package/lib/Utils/use-single-file-auth-state.js +66 -61
- package/lib/Utils/validate-connection.d.ts +5 -2
- package/lib/Utils/validate-connection.js +7 -6
- package/lib/WABinary/constants.d.ts +24 -21
- package/lib/WABinary/constants.js +1302 -31
- package/lib/WABinary/decode.d.ts +4 -1
- package/lib/WABinary/decode.js +267 -234
- package/lib/WABinary/encode.d.ts +1 -0
- package/lib/WABinary/encode.js +248 -226
- package/lib/WABinary/generic-utils.d.ts +13 -1
- package/lib/WABinary/generic-utils.js +113 -96
- package/lib/WABinary/index.js +13 -9
- package/lib/WABinary/jid-utils.d.ts +23 -4
- package/lib/WABinary/jid-utils.js +58 -39
- package/lib/WABinary/types.d.ts +15 -11
- package/lib/WABinary/types.js +1 -0
- package/lib/WAM/BinaryInfo.d.ts +14 -14
- package/lib/WAM/BinaryInfo.js +11 -8
- package/lib/WAM/constants.d.ts +34 -26
- package/lib/WAM/constants.js +15358 -15349
- package/lib/WAM/encode.d.ts +1 -0
- package/lib/WAM/encode.js +153 -144
- package/lib/WAM/index.js +13 -9
- package/lib/index.js +11 -11
- package/package.json +1 -66
- package/WASignalGroup/GroupProtocol.js +0 -1771
- package/WASignalGroup/ciphertext_message.js +0 -10
- package/WASignalGroup/group_cipher.js +0 -103
- package/WASignalGroup/group_session_builder.js +0 -39
- package/WASignalGroup/index.js +0 -5
- package/WASignalGroup/keyhelper.js +0 -17
- package/WASignalGroup/protobufs.js +0 -2
- package/WASignalGroup/queue_job.js +0 -64
- package/WASignalGroup/sender_chain_key.js +0 -38
- package/WASignalGroup/sender_key_distribution_message.js +0 -68
- package/WASignalGroup/sender_key_message.js +0 -79
- package/WASignalGroup/sender_key_name.js +0 -59
- package/WASignalGroup/sender_key_record.js +0 -47
- package/WASignalGroup/sender_key_state.js +0 -110
- package/WASignalGroup/sender_message_key.js +0 -30
package/lib/Socket/groups.js
CHANGED
|
@@ -65,6 +65,16 @@ const makeGroupsSocket = (config) => {
|
|
|
65
65
|
return data
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
suki.ws.on('CB:ib,,dirty', async (node) => {
|
|
69
|
+
const { attrs } = WABinary_1.getBinaryNodeChild(node, 'dirty')
|
|
70
|
+
if (attrs.type !== 'groups') {
|
|
71
|
+
return
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
await groupFetchAllParticipating()
|
|
75
|
+
await suki.cleanDirtyBits('groups')
|
|
76
|
+
})
|
|
77
|
+
|
|
68
78
|
return {
|
|
69
79
|
...suki,
|
|
70
80
|
groupQuery,
|
|
@@ -308,12 +318,10 @@ const extractGroupMetadata = (result) => {
|
|
|
308
318
|
addressingMode: mode,
|
|
309
319
|
subject: group.attrs.subject,
|
|
310
320
|
subjectOwner: mode === 'lid' ? group.attrs.s_o_pn : group.attrs.s_o,
|
|
311
|
-
subjectOwnerJid: mode === 'lid' ? group.attrs.s_o_pn : group.attrs.s_o,
|
|
312
321
|
subjectTime: +group.attrs.s_t,
|
|
313
322
|
size: group.attrs?.size ? +group.attrs.size : WABinary_1.getBinaryNodeChildren(group, 'participant').length,
|
|
314
323
|
creation: +group.attrs.creation,
|
|
315
324
|
owner: group.attrs.creator ? WABinary_1.jidNormalizedUser(mode === 'lid' ? group.attrs.creator_pn : group.attrs.creator) : undefined,
|
|
316
|
-
ownerJid: group.attrs.creator ? WABinary_1.jidNormalizedUser(mode === 'lid' ? group.attrs.creator_pn : group.attrs.creator) : undefined,
|
|
317
325
|
ownerCountry: group.attrs.creator_country_code,
|
|
318
326
|
desc,
|
|
319
327
|
descId,
|
|
@@ -327,7 +335,6 @@ const extractGroupMetadata = (result) => {
|
|
|
327
335
|
participants: WABinary_1.getBinaryNodeChildren(group, 'participant').map(({ attrs }) => {
|
|
328
336
|
return {
|
|
329
337
|
id: mode === 'lid' ? attrs.phone_number : attrs.jid,
|
|
330
|
-
jid: mode === 'lid' ? attrs.phone_number : attrs.jid,
|
|
331
338
|
lid: mode === 'lid' ? attrs.jid : attrs.lid,
|
|
332
339
|
admin: (attrs.type || null),
|
|
333
340
|
}
|
package/lib/Socket/index.d.ts
CHANGED
|
@@ -47,7 +47,6 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
47
47
|
getEphemeralGroup: (jid: string) => Promise<number>
|
|
48
48
|
updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>
|
|
49
49
|
sendStatusMentions: (content: import("../Types").WAProto.IMessage, jid: string, Private?: boolean) => Promise<string>
|
|
50
|
-
sendAlbumMessage: (jid: string, medias: import("../Types").WAProto.IMessage, options?: import("../Types").MiscMessageGenerationOptions) => Promise<string>
|
|
51
50
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>
|
|
52
51
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
53
52
|
duration: string
|
|
@@ -65,6 +64,9 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
65
64
|
newsletterQuery: (jid: string, type: string, content: BinaryNode) => Promise<BinaryNode>
|
|
66
65
|
newsletterWMexQuery: (jid?: string | undefined, query_id: number, content: BinaryNode) => Promise<BinaryNode>
|
|
67
66
|
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>
|
|
67
|
+
newsletterFetchAllParticipating: () => Promise<{
|
|
68
|
+
[_: string]: import("../Types").NewsletterMetadata
|
|
69
|
+
}>
|
|
68
70
|
newsletterAdminCount: (jid: string) => Promise<number>
|
|
69
71
|
newsletterChangeOwner: (jid: string, userLid: string) => Promise<void>
|
|
70
72
|
newsletterDemote: (jid: string, userLid: string) => Promise<void>
|
|
@@ -108,6 +110,7 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
108
110
|
}
|
|
109
111
|
upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>
|
|
110
112
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>
|
|
113
|
+
createCallLink: (type: 'audio' | 'video', event?: number, timeoutMs?: number) => Promise<void>
|
|
111
114
|
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>
|
|
112
115
|
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>
|
|
113
116
|
getBotListV2: () => Promise<BotListInfo[]>
|
|
@@ -135,6 +138,7 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
|
|
|
135
138
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>
|
|
136
139
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>
|
|
137
140
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>
|
|
141
|
+
updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>
|
|
138
142
|
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>
|
|
139
143
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>
|
|
140
144
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>
|
package/lib/Socket/index.js
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
"use strict"
|
|
2
|
+
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true })
|
|
4
|
+
|
|
3
5
|
const Defaults_1 = require("../Defaults")
|
|
4
|
-
const
|
|
6
|
+
const community_1 = require("./community")
|
|
7
|
+
|
|
5
8
|
// export the last socket layer
|
|
6
|
-
const makeWASocket = (config) =>
|
|
7
|
-
|
|
8
|
-
...
|
|
9
|
-
|
|
9
|
+
const makeWASocket = (config) => {
|
|
10
|
+
const newConfig = {
|
|
11
|
+
...Defaults_1.DEFAULT_CONNECTION_CONFIG,
|
|
12
|
+
...config
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// If the user hasn't provided their own history sync function,
|
|
16
|
+
// let's create a default one that respects the syncFullHistory flag.
|
|
17
|
+
if (config.shouldSyncHistoryMessage === undefined) {
|
|
18
|
+
newConfig.shouldSyncHistoryMessage = () => !!newConfig.syncFullHistory
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return community_1.makeCommunitiesSocket(newConfig)
|
|
22
|
+
}
|
|
23
|
+
|
|
10
24
|
exports.default = makeWASocket
|
|
@@ -36,7 +36,6 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
36
36
|
getEphemeralGroup: (jid: string) => Promise<number>
|
|
37
37
|
updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>
|
|
38
38
|
sendStatusMentions: (content: import("../Types").WAProto.IMessage, jid: string, Private?: boolean) => Promise<string>
|
|
39
|
-
sendAlbumMessage: (jid: string, medias: import("../Types").WAProto.IMessage, options?: import("../Types").MiscMessageGenerationOptions) => Promise<string>
|
|
40
39
|
sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>
|
|
41
40
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
42
41
|
duration: string
|
|
@@ -54,6 +53,9 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
54
53
|
newsletterQuery: (jid: string, type: string, content: BinaryNode) => Promise<BinaryNode>
|
|
55
54
|
newsletterWMexQuery: (jid?: string | undefined, query_id: number, content: BinaryNode) => Promise<BinaryNode>
|
|
56
55
|
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>
|
|
56
|
+
newsletterFetchAllParticipating: () => Promise<{
|
|
57
|
+
[_: string]: import("../Types").NewsletterMetadata
|
|
58
|
+
}>
|
|
57
59
|
newsletterAdminCount: (jid: string) => Promise<number>
|
|
58
60
|
newsletterChangeOwner: (jid: string, userLid: string) => Promise<void>
|
|
59
61
|
newsletterDemote: (jid: string, userLid: string) => Promise<void>
|
|
@@ -97,6 +99,7 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
97
99
|
}
|
|
98
100
|
upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>
|
|
99
101
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>
|
|
102
|
+
createCallLink: (type: 'audio' | 'video', event?: number, timeoutMs?: number) => Promise<void>
|
|
100
103
|
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>
|
|
101
104
|
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>
|
|
102
105
|
getLidUser: (jid: string) => Promise<{
|
|
@@ -123,6 +126,7 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
123
126
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>
|
|
124
127
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>
|
|
125
128
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>
|
|
129
|
+
updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>
|
|
126
130
|
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>
|
|
127
131
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>
|
|
128
132
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>
|
|
@@ -169,4 +173,4 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
|
|
|
169
173
|
requestPairingCode: (phoneNumber: string, code?: string) => Promise<string>
|
|
170
174
|
waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>
|
|
171
175
|
sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>
|
|
172
|
-
}
|
|
176
|
+
}
|
|
@@ -944,16 +944,17 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
944
944
|
const type_2 = Utils_1.getContentType(content)
|
|
945
945
|
const message = msg.message[type_2]
|
|
946
946
|
|
|
947
|
-
|
|
947
|
+
if (node?.attrs?.addressing_mode === 'lid') {
|
|
948
948
|
const metadata = await groupMetadata(node.attrs.from)
|
|
949
949
|
let found = metadata.participants.find(p => p.lid === node.attrs.participant)
|
|
950
950
|
|
|
951
951
|
msg.key.participant = found.id
|
|
952
952
|
|
|
953
953
|
if (message?.contextInfo?.participant) {
|
|
954
|
-
|
|
954
|
+
found = metadata.participants.find(p => p.lid === msg.message[type_2].contextInfo.participant)
|
|
955
955
|
msg.message[type_2].contextInfo.participant = found.id
|
|
956
956
|
}
|
|
957
|
+
|
|
957
958
|
if (message?.contextInfo?.mentionedJid?.length > 0) {
|
|
958
959
|
let mentions = []
|
|
959
960
|
for (const id of message.contextInfo.mentionedJid) {
|
|
@@ -963,16 +964,18 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
963
964
|
msg.message[type_2].contextInfo.mentionedJid = mentions
|
|
964
965
|
}
|
|
965
966
|
}
|
|
966
|
-
|
|
967
|
+
|
|
967
968
|
if (!WABinary_1.isJidGroup(node.attrs.from) && WABinary_1.isLidUser(WABinary_1.jidNormalizedUser(node.attrs.from))) {
|
|
968
|
-
|
|
969
|
-
|
|
969
|
+
const senderPn = WABinary_1.jidNormalizedUser(node.attrs.peer_recipient_pn || node.attrs.sender_pn)
|
|
970
|
+
msg.key.remoteJid = senderPn
|
|
971
|
+
|
|
970
972
|
if (message?.contextInfo?.participant) {
|
|
971
|
-
|
|
973
|
+
const isMe = msg.message[type_2].contextInfo.participant === WABinary_1.jidNormalizedUser(authState.creds.me.lid)
|
|
972
974
|
msg.message[type_2].contextInfo.participant = isMe ? WABinary_1.jidNormalizedUser(authState.creds.me.id) : senderPn
|
|
973
975
|
}
|
|
976
|
+
|
|
974
977
|
if (message?.contextInfo?.mentionedJid?.length > 0) {
|
|
975
|
-
|
|
978
|
+
msg.message[type_2].contextInfo.mentionedJid = [senderPn]
|
|
976
979
|
}
|
|
977
980
|
}
|
|
978
981
|
|
|
@@ -1074,11 +1077,31 @@ const makeMessagesRecvSocket = (config) => {
|
|
|
1074
1077
|
}
|
|
1075
1078
|
|
|
1076
1079
|
const handleCall = async (node) => {
|
|
1080
|
+
let status
|
|
1081
|
+
|
|
1077
1082
|
const { attrs } = node
|
|
1078
1083
|
const [infoChild] = WABinary_1.getAllBinaryNodeChildren(node)
|
|
1079
1084
|
const callId = infoChild.attrs['call-id']
|
|
1080
1085
|
const from = infoChild.attrs.from || infoChild.attrs['call-creator']
|
|
1081
|
-
|
|
1086
|
+
status = Utils_1.getCallStatusFromNode(infoChild)
|
|
1087
|
+
|
|
1088
|
+
if (WABinary_1.isLidUser(from) && infoChild.tag === 'relaylatency') {
|
|
1089
|
+
const verify = callOfferCache.get(callId)
|
|
1090
|
+
|
|
1091
|
+
if (!verify) {
|
|
1092
|
+
status = 'offer'
|
|
1093
|
+
|
|
1094
|
+
const callLid = {
|
|
1095
|
+
chatId: attrs.from,
|
|
1096
|
+
from,
|
|
1097
|
+
id: callId,
|
|
1098
|
+
date: new Date(+attrs.t * 1000),
|
|
1099
|
+
offline: !!attrs.offline,
|
|
1100
|
+
status
|
|
1101
|
+
}
|
|
1102
|
+
callOfferCache.set(callId, callLid)
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1082
1105
|
|
|
1083
1106
|
const call = {
|
|
1084
1107
|
chatId: attrs.from,
|
|
@@ -26,7 +26,6 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
26
26
|
getEphemeralGroup: (jid: string) => Promise<number>
|
|
27
27
|
updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>
|
|
28
28
|
sendStatusMentions: (content: import("../Types").WAProto.IMessage, jid: string, Private?: boolean) => Promise<string>
|
|
29
|
-
sendAlbumMessage: (jid: string, medias: import("../Types").WAProto.IMessage, options?: import("../Types").MiscMessageGenerationOptions) => Promise<string>
|
|
30
29
|
sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>
|
|
31
30
|
subscribeNewsletterUpdates: (jid: string) => Promise<{
|
|
32
31
|
duration: string
|
|
@@ -44,6 +43,9 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
44
43
|
newsletterQuery: (jid: string, type: string, content: BinaryNode) => Promise<BinaryNode>
|
|
45
44
|
newsletterWMexQuery: (jid?: string | undefined, query_id: number, content: BinaryNode) => Promise<BinaryNode>
|
|
46
45
|
newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>
|
|
46
|
+
newsletterFetchAllParticipating: () => Promise<{
|
|
47
|
+
[_: string]: import("../Types").NewsletterMetadata
|
|
48
|
+
}>
|
|
47
49
|
newsletterAdminCount: (jid: string) => Promise<number>
|
|
48
50
|
newsletterChangeOwner: (jid: string, userLid: string) => Promise<void>
|
|
49
51
|
newsletterDemote: (jid: string, userLid: string) => Promise<void>
|
|
@@ -87,6 +89,7 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
87
89
|
}
|
|
88
90
|
upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>
|
|
89
91
|
appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>
|
|
92
|
+
createCallLink: (type: 'audio' | 'video', event?: number, timeoutMs?: number) => Promise<void>
|
|
90
93
|
sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>
|
|
91
94
|
presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>
|
|
92
95
|
getBotListV2: () => Promise<BotListInfo[]>
|
|
@@ -114,6 +117,7 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
|
|
|
114
117
|
updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>
|
|
115
118
|
updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>
|
|
116
119
|
updateDefaultDisappearingMode: (duration: number) => Promise<void>
|
|
120
|
+
updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>
|
|
117
121
|
getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>
|
|
118
122
|
resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>
|
|
119
123
|
chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>
|