[NOWEB] - mark connection as offline by flag
The request from Discord https://discord.com/channels/1228605717372604466/1228639621391585354/1256952165516185690
I'm using NOWEB... and I want my users to receive notifications on their devices... so I call /api/{session}/presence with { "presence": "offline" } as soon as I receive the WORKING status. It works fine sometimes... but sometimes when the session receives a message, it goes back online.
Would it be safe to set presence to offline after each message the session receives? Or am I doing something wrong? Each server I have hosts around >300 NOWEB sessions... and they might receive a lot of messages... so it's going to be way too many presence offline requests... no? Is there a chance of getting a number blocked by too many presence offline requests?
We recently added "reconnect session after 30 minutes" behaviour, and at the start it does send "online" status always. We'll fix that, but likely you'll need to add a new flag markOnline: false when running a session.
+1
Added in 2024.9.6
NOWEB Configuration
markOnline: true- sendonlinepresence when session starts (defaulttrue).- Required if you want to get notifications in your phone
- Read more about ✅ Presence
{
"name": "default",
"config": {
"noweb": {
"markOnline": false,
"store": {
...
}
}
}
}
FAQ
👉 I don't get notifications on my phone when WAHA session is connected
- You need to send
offlineafter all presence you send (WhatsApp doesn't send notifications to the device if a web client is active). - For 🏭 NOWEB Engine also mark sure to send
markOnline: falsewhen you create a new session.