fix: do not fire presence update without name

This commit is contained in:
Adhiraj Singh
2022-03-19 08:26:57 +05:30
parent d238826815
commit 54d31edc1d

View File

@@ -368,6 +368,11 @@ export const makeChatsSocket = (config: SocketConfig) => {
const sendPresenceUpdate = async(type: WAPresence, toJid?: string) => {
const me = authState.creds.me!
if(type === 'available' || type === 'unavailable') {
if(!me!.name) {
logger.warn('no name present, ignoring presence update request...')
return
}
await sendNode({
tag: 'presence',
attrs: {