chore: add stronger lint rules

This commit is contained in:
Adhiraj Singh
2022-08-18 10:37:40 +05:30
parent 8d6e00eab6
commit c5917364ba
10 changed files with 101 additions and 103 deletions

View File

@@ -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)