mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
style: use getAllBinaryNodeChildren
This commit is contained in:
@@ -190,7 +190,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
participants = message.messageStubParameters
|
||||
emitParticipantsUpdate('remove')
|
||||
// mark the chat read only if you left the group
|
||||
if (participants.includes(meJid)) {
|
||||
if(participants.includes(meJid)) {
|
||||
chatUpdate.readOnly = true
|
||||
}
|
||||
break
|
||||
@@ -261,7 +261,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
|
||||
const processNotification = (node: BinaryNode): Partial<proto.IWebMessageInfo> => {
|
||||
const result: Partial<proto.IWebMessageInfo> = { }
|
||||
const child = (node.content as BinaryNode[])?.[0]
|
||||
const [child] = getAllBinaryNodeChildren(node)
|
||||
|
||||
if(node.attrs.type === 'w:gp2') {
|
||||
switch(child?.tag) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { proto } from '../../WAProto'
|
||||
import type { AuthenticationState, SocketConfig, SignalKeyStore, AuthenticationCreds, KeyPair, LTHashState } from "../Types"
|
||||
import { Curve, hmacSign, signedKeyPair } from './crypto'
|
||||
import { encodeInt, generateRegistrationId } from './generics'
|
||||
import { BinaryNode, S_WHATSAPP_NET, jidDecode, Binary } from '../WABinary'
|
||||
import { BinaryNode, S_WHATSAPP_NET, jidDecode, Binary, getAllBinaryNodeChildren } from '../WABinary'
|
||||
import { createSignalIdentity } from './signal'
|
||||
|
||||
const ENCODED_VERSION = 'S9Kdc4pc4EJryo21snc5cg=='
|
||||
@@ -164,7 +164,7 @@ export const configureSuccessfulPairing = (
|
||||
stanza: BinaryNode,
|
||||
{ advSecretKey, signedIdentityKey, signalIdentities }: Pick<AuthenticationCreds, 'advSecretKey' | 'signedIdentityKey' | 'signalIdentities'>
|
||||
) => {
|
||||
const pair = stanza.content[0] as BinaryNode
|
||||
const [pair] = getAllBinaryNodeChildren(stanza)
|
||||
const pairContent = Array.isArray(pair.content) ? pair.content : []
|
||||
|
||||
const msgId = stanza.attrs.id
|
||||
|
||||
Reference in New Issue
Block a user