mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
chore: add stronger lint rules
This commit is contained in:
@@ -266,9 +266,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
attrs: {
|
||||
v: '2',
|
||||
type,
|
||||
// do not send extra params
|
||||
// causes retries to fail for some reason now
|
||||
// ...extraAttrs || {}
|
||||
...extraAttrs || {}
|
||||
},
|
||||
content: ciphertext
|
||||
}]
|
||||
@@ -302,7 +300,6 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
const binaryNodeContent: BinaryNode[] = []
|
||||
|
||||
const devices: JidWithDevice[] = []
|
||||
const extraParticipantNodeAttrs: BinaryNode['attrs'] = { }
|
||||
if(participant) {
|
||||
// when the retry request is not for a group
|
||||
// only send to the specific device that asked for a retry
|
||||
@@ -311,8 +308,6 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
additionalAttributes = { ...additionalAttributes, device_fanout: 'false' }
|
||||
}
|
||||
|
||||
extraParticipantNodeAttrs.count = participant.count.toString()
|
||||
|
||||
const { user, device } = jidDecode(participant.jid)!
|
||||
devices.push({ user, device })
|
||||
}
|
||||
@@ -376,7 +371,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
|
||||
await assertSessions(senderKeyJids, false)
|
||||
|
||||
const result = await createParticipantNodes(senderKeyJids, encSenderKeyMsg, extraParticipantNodeAttrs)
|
||||
const result = await createParticipantNodes(senderKeyJids, encSenderKeyMsg)
|
||||
shouldIncludeDeviceIdentity = shouldIncludeDeviceIdentity || result.shouldIncludeDeviceIdentity
|
||||
|
||||
participants.push(...result.nodes)
|
||||
@@ -428,8 +423,8 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
{ nodes: meNodes, shouldIncludeDeviceIdentity: s1 },
|
||||
{ nodes: otherNodes, shouldIncludeDeviceIdentity: s2 }
|
||||
] = await Promise.all([
|
||||
createParticipantNodes(meJids, encodedMeMsg, extraParticipantNodeAttrs),
|
||||
createParticipantNodes(otherJids, encodedMsg, extraParticipantNodeAttrs)
|
||||
createParticipantNodes(meJids, encodedMeMsg),
|
||||
createParticipantNodes(otherJids, encodedMsg)
|
||||
])
|
||||
participants.push(...meNodes)
|
||||
participants.push(...otherNodes)
|
||||
|
||||
Reference in New Issue
Block a user