fix(master): linting warnings

This commit is contained in:
Rajeh Taher
2024-05-10 16:33:59 +03:00
committed by GitHub
parent 88cf6f5234
commit ce325d1182
3 changed files with 9 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ export const makeBusinessSocket = (config: SocketConfig) => {
const getCatalog = async({ jid, limit, cursor }: GetCatalogOptions) => { const getCatalog = async({ jid, limit, cursor }: GetCatalogOptions) => {
jid = jid || authState.creds.me?.id jid = jid || authState.creds.me?.id
jid = jidNormalizedUser(jid!) jid = jidNormalizedUser(jid)
const queryParamNodes: BinaryNode[] = [ const queryParamNodes: BinaryNode[] = [
{ {
@@ -65,7 +65,7 @@ export const makeBusinessSocket = (config: SocketConfig) => {
const getCollections = async(jid?: string, limit = 51) => { const getCollections = async(jid?: string, limit = 51) => {
jid = jid || authState.creds.me?.id jid = jid || authState.creds.me?.id
jid = jidNormalizedUser(jid!) jid = jidNormalizedUser(jid)
const result = await query({ const result = await query({
tag: 'iq', tag: 'iq',
attrs: { attrs: {

View File

@@ -42,7 +42,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
return key return key
} }
const fetchPrivacySettings = async(force: boolean = false) => { const fetchPrivacySettings = async(force = false) => {
if(!privacySettings || force) { if(!privacySettings || force) {
const { content } = await query({ const { content } = await query({
tag: 'iq', tag: 'iq',
@@ -540,7 +540,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
const sendPresenceUpdate = async(type: WAPresence, toJid?: string) => { const sendPresenceUpdate = async(type: WAPresence, toJid?: string) => {
const me = authState.creds.me! const me = authState.creds.me!
if(type === 'available' || type === 'unavailable') { if(type === 'available' || type === 'unavailable') {
if(!me!.name) { if(!me.name) {
logger.warn('no name present, ignoring presence update request...') logger.warn('no name present, ignoring presence update request...')
return return
} }
@@ -550,7 +550,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
await sendNode({ await sendNode({
tag: 'presence', tag: 'presence',
attrs: { attrs: {
name: me!.name, name: me.name,
type type
} }
}) })
@@ -558,7 +558,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
await sendNode({ await sendNode({
tag: 'chatstate', tag: 'chatstate',
attrs: { attrs: {
from: me!.id!, from: me.id,
to: toJid!, to: toJid!,
}, },
content: [ content: [
@@ -840,7 +840,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
// update our pushname too // update our pushname too
if(msg.key.fromMe && msg.pushName && authState.creds.me?.name !== msg.pushName) { if(msg.key.fromMe && msg.pushName && authState.creds.me?.name !== msg.pushName) {
ev.emit('creds.update', { me: { ...authState.creds.me!, name: msg.pushName! } }) ev.emit('creds.update', { me: { ...authState.creds.me!, name: msg.pushName } })
} }
} }

View File

@@ -165,8 +165,8 @@ export const makeGroupsSocket = (config: SocketConfig) => {
}] }]
) )
const node = getBinaryNodeChild(result, 'membership_requests_action') const node = getBinaryNodeChild(result, 'membership_requests_action')
const nodeAction = getBinaryNodeChild(node!, action) const nodeAction = getBinaryNodeChild(node, action)
const participantsAffected = getBinaryNodeChildren(nodeAction!, 'participant') const participantsAffected = getBinaryNodeChildren(nodeAction, 'participant')
return participantsAffected.map(p => { return participantsAffected.map(p => {
return { status: p.attrs.error || '200', jid: p.attrs.jid } return { status: p.attrs.error || '200', jid: p.attrs.jid }
}) })