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.
Files changed (159) hide show
  1. package/WAProto/BotMetadata/BotMetadata.d.ts +594 -1
  2. package/WAProto/BotMetadata/BotMetadata.js +1910 -148
  3. package/WAProto/BotMetadata/BotMetadata.proto +36 -0
  4. package/WAProto/E2E/E2E.d.ts +570 -6
  5. package/WAProto/E2E/E2E.js +1591 -26
  6. package/WAProto/E2E/E2E.proto +10 -1
  7. package/WAProto/HistorySync/HistorySync.d.ts +806 -6
  8. package/WAProto/HistorySync/HistorySync.js +2193 -29
  9. package/WAProto/HistorySync/HistorySync.proto +2 -1
  10. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.d.ts +570 -6
  11. package/WAProto/MdStorageMsgRowOpaqueData/MdStorageMsgRowOpaqueData.js +1591 -26
  12. package/WAProto/StatusAttributions/StatusAttributions.d.ts +2 -1
  13. package/WAProto/StatusAttributions/StatusAttributions.js +7 -0
  14. package/WAProto/StatusAttributions/StatusAttributions.proto +1 -0
  15. package/WAProto/SyncAction/SyncAction.d.ts +230 -0
  16. package/WAProto/SyncAction/SyncAction.js +578 -2
  17. package/WAProto/SyncAction/SyncAction.proto +13 -1
  18. package/WAProto/Web/Web.d.ts +570 -6
  19. package/WAProto/Web/Web.js +1591 -26
  20. package/lib/Defaults/baileys-version.json +2 -2
  21. package/lib/Defaults/index.d.ts +42 -25
  22. package/lib/Defaults/index.js +6 -2
  23. package/lib/Signal/Group/sender-key-record.js +23 -28
  24. package/lib/Signal/libsignal.d.ts +1 -0
  25. package/lib/Socket/Client/index.js +13 -9
  26. package/lib/Socket/Client/types.d.ts +11 -10
  27. package/lib/Socket/Client/types.js +11 -7
  28. package/lib/Socket/Client/websocket.d.ts +9 -8
  29. package/lib/Socket/Client/websocket.js +52 -47
  30. package/lib/Socket/business.d.ts +185 -182
  31. package/lib/Socket/business.js +258 -249
  32. package/lib/Socket/chats.d.ts +90 -87
  33. package/lib/Socket/chats.js +1095 -888
  34. package/lib/Socket/community.d.ts +131 -0
  35. package/lib/Socket/community.js +369 -0
  36. package/lib/Socket/groups.d.ts +50 -41
  37. package/lib/Socket/groups.js +10 -3
  38. package/lib/Socket/index.d.ts +5 -1
  39. package/lib/Socket/index.js +19 -5
  40. package/lib/Socket/messages-recv.d.ts +6 -2
  41. package/lib/Socket/messages-recv.js +31 -8
  42. package/lib/Socket/messages-send.d.ts +5 -1
  43. package/lib/Socket/messages-send.js +1293 -1351
  44. package/lib/Socket/newsletter.d.ts +142 -135
  45. package/lib/Socket/newsletter.js +274 -230
  46. package/lib/Socket/socket.d.ts +37 -35
  47. package/lib/Socket/usync.d.ts +31 -30
  48. package/lib/Socket/usync.js +74 -62
  49. package/lib/Types/Auth.d.ts +89 -72
  50. package/lib/Types/Auth.js +1 -0
  51. package/lib/Types/Call.d.ts +11 -10
  52. package/lib/Types/Call.js +1 -0
  53. package/lib/Types/Chat.d.ts +85 -62
  54. package/lib/Types/Chat.js +4 -1
  55. package/lib/Types/Contact.js +1 -0
  56. package/lib/Types/Events.d.ts +209 -191
  57. package/lib/Types/Events.js +1 -0
  58. package/lib/Types/GroupMetadata.d.ts +12 -27
  59. package/lib/Types/GroupMetadata.js +1 -0
  60. package/lib/Types/Label.d.ts +41 -39
  61. package/lib/Types/Label.js +24 -21
  62. package/lib/Types/LabelAssociation.d.ts +18 -12
  63. package/lib/Types/LabelAssociation.js +6 -3
  64. package/lib/Types/Message.d.ts +3 -2
  65. package/lib/Types/Message.js +7 -3
  66. package/lib/Types/MexUpdates.d.ts +9 -0
  67. package/lib/Types/MexUpdates.js +18 -0
  68. package/lib/Types/Newsletter.d.ts +84 -67
  69. package/lib/Types/Newsletter.js +30 -23
  70. package/lib/Types/Product.d.ts +70 -56
  71. package/lib/Types/Product.js +1 -0
  72. package/lib/Types/Signal.d.ts +46 -35
  73. package/lib/Types/Signal.js +1 -0
  74. package/lib/Types/Socket.d.ts +105 -101
  75. package/lib/Types/Socket.js +1 -0
  76. package/lib/Types/State.d.ts +37 -23
  77. package/lib/Types/State.js +13 -1
  78. package/lib/Types/USync.d.ts +21 -20
  79. package/lib/Types/USync.js +1 -0
  80. package/lib/Types/index.d.ts +51 -42
  81. package/lib/Types/index.js +25 -19
  82. package/lib/Utils/auth-utils.d.ts +14 -11
  83. package/lib/Utils/auth-utils.js +189 -182
  84. package/lib/Utils/baileys-event-stream.d.ts +12 -10
  85. package/lib/Utils/baileys-event-stream.js +52 -46
  86. package/lib/Utils/business.d.ts +15 -8
  87. package/lib/Utils/business.js +229 -217
  88. package/lib/Utils/chat-utils.d.ts +22 -12
  89. package/lib/Utils/chat-utils.js +57 -27
  90. package/lib/Utils/crypto.d.ts +31 -15
  91. package/lib/Utils/crypto.js +136 -107
  92. package/lib/Utils/decode-wa-message.d.ts +34 -245
  93. package/lib/Utils/decode-wa-message.js +205 -217
  94. package/lib/Utils/event-buffer.d.ts +30 -26
  95. package/lib/Utils/event-buffer.js +519 -515
  96. package/lib/Utils/history.d.ts +2 -8
  97. package/lib/Utils/index.js +13 -9
  98. package/lib/Utils/link-preview.d.ts +16 -14
  99. package/lib/Utils/link-preview.js +100 -92
  100. package/lib/Utils/logger.d.ts +9 -7
  101. package/lib/Utils/logger.js +1 -1
  102. package/lib/Utils/lt-hash.d.ts +10 -8
  103. package/lib/Utils/lt-hash.js +49 -44
  104. package/lib/Utils/make-mutex.d.ts +4 -2
  105. package/lib/Utils/make-mutex.js +43 -39
  106. package/lib/Utils/messages-media.d.ts +75 -50
  107. package/lib/Utils/messages.d.ts +60 -35
  108. package/lib/Utils/messages.js +87 -8
  109. package/lib/Utils/noise-handler.d.ts +13 -12
  110. package/lib/Utils/noise-handler.js +143 -138
  111. package/lib/Utils/process-message.d.ts +32 -24
  112. package/lib/Utils/process-message.js +387 -367
  113. package/lib/Utils/signal.d.ts +24 -15
  114. package/lib/Utils/signal.js +143 -131
  115. package/lib/Utils/use-mongo-file-auth-state.d.ts +3 -2
  116. package/lib/Utils/use-mongo-file-auth-state.js +72 -63
  117. package/lib/Utils/use-multi-file-auth-state.d.ts +9 -8
  118. package/lib/Utils/use-multi-file-auth-state.js +110 -102
  119. package/lib/Utils/use-single-file-auth-state.d.ts +8 -7
  120. package/lib/Utils/use-single-file-auth-state.js +66 -61
  121. package/lib/Utils/validate-connection.d.ts +5 -2
  122. package/lib/Utils/validate-connection.js +7 -6
  123. package/lib/WABinary/constants.d.ts +24 -21
  124. package/lib/WABinary/constants.js +1302 -31
  125. package/lib/WABinary/decode.d.ts +4 -1
  126. package/lib/WABinary/decode.js +267 -234
  127. package/lib/WABinary/encode.d.ts +1 -0
  128. package/lib/WABinary/encode.js +248 -226
  129. package/lib/WABinary/generic-utils.d.ts +13 -1
  130. package/lib/WABinary/generic-utils.js +113 -96
  131. package/lib/WABinary/index.js +13 -9
  132. package/lib/WABinary/jid-utils.d.ts +23 -4
  133. package/lib/WABinary/jid-utils.js +58 -39
  134. package/lib/WABinary/types.d.ts +15 -11
  135. package/lib/WABinary/types.js +1 -0
  136. package/lib/WAM/BinaryInfo.d.ts +14 -14
  137. package/lib/WAM/BinaryInfo.js +11 -8
  138. package/lib/WAM/constants.d.ts +34 -26
  139. package/lib/WAM/constants.js +15358 -15349
  140. package/lib/WAM/encode.d.ts +1 -0
  141. package/lib/WAM/encode.js +153 -144
  142. package/lib/WAM/index.js +13 -9
  143. package/lib/index.js +11 -11
  144. package/package.json +1 -66
  145. package/WASignalGroup/GroupProtocol.js +0 -1771
  146. package/WASignalGroup/ciphertext_message.js +0 -10
  147. package/WASignalGroup/group_cipher.js +0 -103
  148. package/WASignalGroup/group_session_builder.js +0 -39
  149. package/WASignalGroup/index.js +0 -5
  150. package/WASignalGroup/keyhelper.js +0 -17
  151. package/WASignalGroup/protobufs.js +0 -2
  152. package/WASignalGroup/queue_job.js +0 -64
  153. package/WASignalGroup/sender_chain_key.js +0 -38
  154. package/WASignalGroup/sender_key_distribution_message.js +0 -68
  155. package/WASignalGroup/sender_key_message.js +0 -79
  156. package/WASignalGroup/sender_key_name.js +0 -59
  157. package/WASignalGroup/sender_key_record.js +0 -47
  158. package/WASignalGroup/sender_key_state.js +0 -110
  159. package/WASignalGroup/sender_message_key.js +0 -30
@@ -1,150 +1,155 @@
1
1
  "use strict"
2
+
2
3
  Object.defineProperty(exports, "__esModule", { value: true })
4
+
3
5
  const boom_1 = require("@hapi/boom")
4
6
  const WAProto_1 = require("../../WAProto")
5
7
  const Defaults_1 = require("../Defaults")
6
8
  const WABinary_1 = require("../WABinary")
7
9
  const crypto_1 = require("./crypto")
10
+
8
11
  const generateIV = (counter) => {
9
- const iv = new ArrayBuffer(12)
10
- new DataView(iv).setUint32(8, counter)
11
- return new Uint8Array(iv)
12
+ const iv = new ArrayBuffer(12)
13
+ new DataView(iv).setUint32(8, counter)
14
+ return new Uint8Array(iv)
12
15
  }
16
+
13
17
  const makeNoiseHandler = ({ keyPair: { private: privateKey, public: publicKey }, NOISE_HEADER, logger, routingInfo }) => {
14
- logger = logger.child({ class: 'ns' })
15
- const authenticate = (data) => {
16
- if (!isFinished) {
17
- hash = crypto_1.sha256(Buffer.concat([hash, data]))
18
- }
19
- }
20
- const encrypt = (plaintext) => {
21
- const result = crypto_1.aesEncryptGCM(plaintext, encKey, generateIV(writeCounter), hash)
22
- writeCounter += 1
23
- authenticate(result)
24
- return result
25
- }
26
- const decrypt = (ciphertext) => {
27
- // before the handshake is finished, we use the same counter
28
- // after handshake, the counters are different
29
- const iv = generateIV(isFinished ? readCounter : writeCounter)
30
- const result = crypto_1.aesDecryptGCM(ciphertext, decKey, iv, hash)
31
- if (isFinished) {
32
- readCounter += 1
33
- }
34
- else {
35
- writeCounter += 1
36
- }
37
- authenticate(ciphertext)
38
- return result
39
- }
40
- const localHKDF = async (data) => {
41
- const key = await crypto_1.hkdf(Buffer.from(data), 64, { salt, info: '' })
42
- return [key.slice(0, 32), key.slice(32)]
43
- }
44
- const mixIntoKey = async (data) => {
45
- const [write, read] = await localHKDF(data)
46
- salt = write
47
- encKey = read
48
- decKey = read
49
- readCounter = 0
50
- writeCounter = 0
51
- }
52
- const finishInit = async () => {
53
- const [write, read] = await localHKDF(new Uint8Array(0))
54
- encKey = write
55
- decKey = read
56
- hash = Buffer.from([])
57
- readCounter = 0
58
- writeCounter = 0
59
- isFinished = true
60
- }
61
- const data = Buffer.from(Defaults_1.NOISE_MODE)
62
- let hash = data.byteLength === 32 ? data : crypto_1.sha256(data)
63
- let salt = hash
64
- let encKey = hash
65
- let decKey = hash
66
- let readCounter = 0
67
- let writeCounter = 0
68
- let isFinished = false
69
- let sentIntro = false
70
- let inBytes = Buffer.alloc(0)
71
- authenticate(NOISE_HEADER)
72
- authenticate(publicKey)
73
- return {
74
- encrypt,
75
- decrypt,
76
- authenticate,
77
- mixIntoKey,
78
- finishInit,
79
- processHandshake: async ({ serverHello }, noiseKey) => {
80
- authenticate(serverHello.ephemeral)
81
- await mixIntoKey(crypto_1.Curve.sharedKey(privateKey, serverHello.ephemeral))
82
- const decStaticContent = decrypt(serverHello.static)
83
- await mixIntoKey(crypto_1.Curve.sharedKey(privateKey, decStaticContent))
84
- const certDecoded = decrypt(serverHello.payload)
85
- const { intermediate: certIntermediate } = WAProto_1.proto.CertChain.decode(certDecoded)
86
- const { issuerSerial } = WAProto_1.proto.CertChain.NoiseCertificate.Details.decode(certIntermediate.details)
87
- if (issuerSerial !== Defaults_1.WA_CERT_DETAILS.SERIAL) {
88
- throw new boom_1.Boom('certification match failed', { statusCode: 400 })
89
- }
90
- const keyEnc = encrypt(noiseKey.public)
91
- await mixIntoKey(crypto_1.Curve.sharedKey(noiseKey.private, serverHello.ephemeral))
92
- return keyEnc
93
- },
94
- encodeFrame: (data) => {
95
- if (isFinished) {
96
- data = encrypt(data)
97
- }
98
- let header
99
- if (routingInfo) {
100
- header = Buffer.alloc(7)
101
- header.write('ED', 0, 'utf8')
102
- header.writeUint8(0, 2)
103
- header.writeUint8(1, 3)
104
- header.writeUint8(routingInfo.byteLength >> 16, 4)
105
- header.writeUint16BE(routingInfo.byteLength & 65535, 5)
106
- header = Buffer.concat([header, routingInfo, NOISE_HEADER])
107
- }
108
- else {
109
- header = Buffer.from(NOISE_HEADER)
110
- }
111
- const introSize = sentIntro ? 0 : header.length
112
- const frame = Buffer.alloc(introSize + 3 + data.byteLength)
113
- if (!sentIntro) {
114
- frame.set(header)
115
- sentIntro = true
116
- }
117
- frame.writeUInt8(data.byteLength >> 16, introSize)
118
- frame.writeUInt16BE(65535 & data.byteLength, introSize + 1)
119
- frame.set(data, introSize + 3)
120
- return frame
121
- },
122
- decodeFrame: async (newData, onFrame) => {
123
- // the binary protocol uses its own framing mechanism
124
- // on top of the WS frames
125
- // so we get this data and separate out the frames
126
- const getBytesSize = () => {
127
- if (inBytes.length >= 3) {
128
- return (inBytes.readUInt8() << 16) | inBytes.readUInt16BE(1)
129
- }
130
- }
131
- inBytes = Buffer.concat([inBytes, newData])
132
- logger.trace(`recv ${newData.length} bytes, total recv ${inBytes.length} bytes`)
133
- let size = getBytesSize()
134
- while (size && inBytes.length >= size + 3) {
135
- let frame = inBytes.slice(3, size + 3)
136
- inBytes = inBytes.slice(size + 3)
137
- if (isFinished) {
138
- const result = decrypt(frame)
139
- frame = await WABinary_1.decodeBinaryNode(result)
140
- }
141
- logger.trace({ msg: frame?.attrs?.id }, 'recv frame')
142
- onFrame(frame)
143
- size = getBytesSize()
144
- }
145
- }
146
- }
147
- }
18
+ logger = logger.child({ class: 'ns' })
19
+ const authenticate = (data) => {
20
+ if (!isFinished) {
21
+ hash = crypto_1.sha256(Buffer.concat([hash, data]))
22
+ }
23
+ }
24
+ const encrypt = (plaintext) => {
25
+ const result = crypto_1.aesEncryptGCM(plaintext, encKey, generateIV(writeCounter), hash)
26
+ writeCounter += 1
27
+ authenticate(result)
28
+ return result
29
+ }
30
+ const decrypt = (ciphertext) => {
31
+ // before the handshake is finished, we use the same counter
32
+ // after handshake, the counters are different
33
+ const iv = generateIV(isFinished ? readCounter : writeCounter)
34
+ const result = crypto_1.aesDecryptGCM(ciphertext, decKey, iv, hash)
35
+ if (isFinished) {
36
+ readCounter += 1
37
+ }
38
+ else {
39
+ writeCounter += 1
40
+ }
41
+ authenticate(ciphertext)
42
+ return result
43
+ }
44
+ const localHKDF = async (data) => {
45
+ const key = await crypto_1.hkdf(Buffer.from(data), 64, { salt, info: '' })
46
+ return [key.slice(0, 32), key.slice(32)]
47
+ }
48
+ const mixIntoKey = async (data) => {
49
+ const [write, read] = await localHKDF(data)
50
+ salt = write
51
+ encKey = read
52
+ decKey = read
53
+ readCounter = 0
54
+ writeCounter = 0
55
+ }
56
+ const finishInit = async () => {
57
+ const [write, read] = await localHKDF(new Uint8Array(0))
58
+ encKey = write
59
+ decKey = read
60
+ hash = Buffer.from([])
61
+ readCounter = 0
62
+ writeCounter = 0
63
+ isFinished = true
64
+ }
65
+ const data = Buffer.from(Defaults_1.NOISE_MODE)
66
+ let hash = data.byteLength === 32 ? data : crypto_1.sha256(data)
67
+ let salt = hash
68
+ let encKey = hash
69
+ let decKey = hash
70
+ let readCounter = 0
71
+ let writeCounter = 0
72
+ let isFinished = false
73
+ let sentIntro = false
74
+ let inBytes = Buffer.alloc(0)
75
+ authenticate(NOISE_HEADER)
76
+ authenticate(publicKey)
77
+ return {
78
+ encrypt,
79
+ decrypt,
80
+ authenticate,
81
+ mixIntoKey,
82
+ finishInit,
83
+ processHandshake: async ({ serverHello }, noiseKey) => {
84
+ authenticate(serverHello.ephemeral)
85
+ await mixIntoKey(crypto_1.Curve.sharedKey(privateKey, serverHello.ephemeral))
86
+ const decStaticContent = decrypt(serverHello.static)
87
+ await mixIntoKey(crypto_1.Curve.sharedKey(privateKey, decStaticContent))
88
+ const certDecoded = decrypt(serverHello.payload)
89
+ const { intermediate: certIntermediate } = WAProto_1.proto.CertChain.decode(certDecoded)
90
+ const { issuerSerial } = WAProto_1.proto.CertChain.NoiseCertificate.Details.decode(certIntermediate.details)
91
+ if (issuerSerial !== Defaults_1.WA_CERT_DETAILS.SERIAL) {
92
+ throw new boom_1.Boom('certification match failed', { statusCode: 400 })
93
+ }
94
+ const keyEnc = encrypt(noiseKey.public)
95
+ await mixIntoKey(crypto_1.Curve.sharedKey(noiseKey.private, serverHello.ephemeral))
96
+ return keyEnc
97
+ },
98
+ encodeFrame: (data) => {
99
+ if (isFinished) {
100
+ data = encrypt(data)
101
+ }
102
+ let header
103
+ if (routingInfo) {
104
+ header = Buffer.alloc(7)
105
+ header.write('ED', 0, 'utf8')
106
+ header.writeUint8(0, 2)
107
+ header.writeUint8(1, 3)
108
+ header.writeUint8(routingInfo.byteLength >> 16, 4)
109
+ header.writeUint16BE(routingInfo.byteLength & 65535, 5)
110
+ header = Buffer.concat([header, routingInfo, NOISE_HEADER])
111
+ }
112
+ else {
113
+ header = Buffer.from(NOISE_HEADER)
114
+ }
115
+ const introSize = sentIntro ? 0 : header.length
116
+ const frame = Buffer.alloc(introSize + 3 + data.byteLength)
117
+ if (!sentIntro) {
118
+ frame.set(header)
119
+ sentIntro = true
120
+ }
121
+ frame.writeUInt8(data.byteLength >> 16, introSize)
122
+ frame.writeUInt16BE(65535 & data.byteLength, introSize + 1)
123
+ frame.set(data, introSize + 3)
124
+ return frame
125
+ },
126
+ decodeFrame: async (newData, onFrame) => {
127
+ // the binary protocol uses its own framing mechanism
128
+ // on top of the WS frames
129
+ // so we get this data and separate out the frames
130
+ const getBytesSize = () => {
131
+ if (inBytes.length >= 3) {
132
+ return (inBytes.readUInt8() << 16) | inBytes.readUInt16BE(1)
133
+ }
134
+ }
135
+ inBytes = Buffer.concat([inBytes, newData])
136
+ logger.trace(`recv ${newData.length} bytes, total recv ${inBytes.length} bytes`)
137
+ let size = getBytesSize()
138
+ while (size && inBytes.length >= size + 3) {
139
+ let frame = inBytes.slice(3, size + 3)
140
+ inBytes = inBytes.slice(size + 3)
141
+ if (isFinished) {
142
+ const result = decrypt(frame)
143
+ frame = await WABinary_1.decodeBinaryNode(result)
144
+ }
145
+ logger.trace({ msg: frame?.attrs?.id }, 'recv frame')
146
+ onFrame(frame)
147
+ size = getBytesSize()
148
+ }
149
+ }
150
+ }
151
+ }
152
+
148
153
  module.exports = {
149
- makeNoiseHandler
154
+ makeNoiseHandler
150
155
  }
@@ -2,40 +2,48 @@ import { AxiosRequestConfig } from 'axios'
2
2
  import { proto } from '../../WAProto'
3
3
  import { AuthenticationCreds, BaileysEventEmitter, CacheStore, SignalKeyStoreWithTransaction, SocketConfig } from '../Types'
4
4
  import { ILogger } from './logger'
5
+
5
6
  type ProcessMessageContext = {
6
- shouldProcessHistoryMsg: boolean
7
- placeholderResendCache?: CacheStore
8
- creds: AuthenticationCreds
9
- keyStore: SignalKeyStoreWithTransaction
10
- ev: BaileysEventEmitter
11
- getMessage: SocketConfig['getMessage']
12
- logger?: ILogger
13
- options: AxiosRequestConfig<{}>
7
+ shouldProcessHistoryMsg: boolean
8
+ placeholderResendCache?: CacheStore
9
+ creds: AuthenticationCreds
10
+ keyStore: SignalKeyStoreWithTransaction
11
+ ev: BaileysEventEmitter
12
+ getMessage: SocketConfig['getMessage']
13
+ logger?: ILogger
14
+ options: AxiosRequestConfig<{}>
14
15
  }
16
+
15
17
  /** Cleans a received message to further processing */
16
18
  export declare const cleanMessage: (message: proto.IWebMessageInfo, meId: string) => void
19
+
17
20
  export declare const isRealMessage: (message: proto.IWebMessageInfo, meId: string) => boolean | undefined
21
+
18
22
  export declare const shouldIncrementChatUnread: (message: proto.IWebMessageInfo) => boolean
23
+
19
24
  /**
20
- * Get the ID of the chat from the given key.
21
- * Typically -- that'll be the remoteJid, but for broadcasts, it'll be the participant
22
- */
25
+ * Get the ID of the chat from the given key.
26
+ * Typically -- that'll be the remoteJid, but for broadcasts, it'll be the participant
27
+ */
23
28
  export declare const getChatId: ({ remoteJid, participant, fromMe }: proto.IMessageKey) => string
29
+
24
30
  type PollContext = {
25
- /** normalised jid of the person that created the poll */
26
- pollCreatorJid: string
27
- /** ID of the poll creation message */
28
- pollMsgId: string
29
- /** poll creation message enc key */
30
- pollEncKey: Uint8Array
31
- /** jid of the person that voted */
32
- voterJid: string
31
+ /** normalised jid of the person that created the poll */
32
+ pollCreatorJid: string
33
+ /** ID of the poll creation message */
34
+ pollMsgId: string
35
+ /** poll creation message enc key */
36
+ pollEncKey: Uint8Array
37
+ /** jid of the person that voted */
38
+ voterJid: string
33
39
  }
40
+
34
41
  /**
35
- * Decrypt a poll vote
36
- * @param vote encrypted vote
37
- * @param ctx additional info about the poll required for decryption
38
- * @returns list of SHA256 options
39
- */
42
+ * Decrypt a poll vote
43
+ * @param vote encrypted vote
44
+ * @param ctx additional info about the poll required for decryption
45
+ * @returns list of SHA256 options
46
+ */
40
47
  export declare function decryptPollVote({ encPayload, encIv }: proto.Message.IPollEncValue, { pollCreatorJid, pollMsgId, pollEncKey, voterJid, }: PollContext): proto.Message.PollVoteMessage
48
+
41
49
  export declare const processMessage: (message: proto.IWebMessageInfo, { shouldProcessHistoryMsg, placeholderResendCache, ev, creds, keyStore, logger, options, getMessage }: ProcessMessageContext) => Promise<void>