From e00f9c6293cba5ec392fa20fb2ddc318ef85258a Mon Sep 17 00:00:00 2001 From: my Date: Tue, 15 Sep 2026 15:54:57 +0200 Subject: [PATCH] prevent flooding of 'left' messages --- src/meshberry/chat.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/meshberry/chat.cpp b/src/meshberry/chat.cpp index e8edb9b..6fa072d 100644 --- a/src/meshberry/chat.cpp +++ b/src/meshberry/chat.cpp @@ -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.