prevent flooding of 'left' messages

This commit is contained in:
my 2026-09-15 15:54:57 +02:00
parent 8b03bc5e84
commit e00f9c6293

View file

@ -524,7 +524,9 @@ void checkPresenceTimeouts() {
if ((now - nodesConnected[i].lastSeen) > TIMEOUT_PRESENCE) {
char m[MAX_MSG_LEN];
snprintf(m, sizeof(m), "%s left the chat!", nodesConnected[i].nick);
broadcastChatMessage("System", m);
// broadcastChatMessage("System", m); // lets not broadcast this, but:
ui_push_message("", m, false, true);
for (int j = i; j < nodesCount-1; ++j)
nodesConnected[j] = nodesConnected[j+1];
@ -653,7 +655,9 @@ Touch is quirky and not recommended.
static void go_to_sleep() {
char m[MAX_MSG_LEN];
snprintf(m, sizeof(m), "%s left the chat!", currentNick);
broadcastChatMessage("System", m);
// broadcastChatMessage("System", m); // same here, only show don't broadcasst
ui_push_message("", m, false, true);
delay(200); // let the packet fly
// Hold the backlight OFF pin through deep sleep so the screen stays dark.