mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: do not fire presence update without name
This commit is contained in:
@@ -368,6 +368,11 @@ 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) {
|
||||||
|
logger.warn('no name present, ignoring presence update request...')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
await sendNode({
|
await sendNode({
|
||||||
tag: 'presence',
|
tag: 'presence',
|
||||||
attrs: {
|
attrs: {
|
||||||
|
|||||||
Reference in New Issue
Block a user