mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
potential fix for QR scan. the server may expect these messages to be sent on reconnect after scan (#959)
* potential fix for QR scan. the server may expect these messages to be sent on reconnect after scan. * refactor: extract dictionary reduce code into utility * refactor: convert the props + abt send req to somewhat useful query Co-authored-by: Adhiraj Singh <adhirajsingh1001@gmail.com>
This commit is contained in:
@@ -308,5 +308,16 @@ export const assertNodeErrorFree = (node: BinaryNode) => {
|
||||
}
|
||||
}
|
||||
|
||||
export const reduceBinaryNodeToDictionary = (node: BinaryNode, tag: string) => {
|
||||
const nodes = getBinaryNodeChildren(node, tag)
|
||||
const dict = nodes.reduce(
|
||||
(dict, { attrs }) => {
|
||||
dict[attrs.name || attrs.config_code] = attrs.value || attrs.config_value
|
||||
return dict
|
||||
}, { } as { [_: string]: string }
|
||||
)
|
||||
return dict
|
||||
}
|
||||
|
||||
export * from './jid-utils'
|
||||
export { Binary } from '../../WABinary/Binary'
|
||||
Reference in New Issue
Block a user