prevent flooding of 'left' messages
This commit is contained in:
parent
8b03bc5e84
commit
e00f9c6293
|
|
@ -524,7 +524,9 @@ void checkPresenceTimeouts() {
|
||||||
if ((now - nodesConnected[i].lastSeen) > TIMEOUT_PRESENCE) {
|
if ((now - nodesConnected[i].lastSeen) > TIMEOUT_PRESENCE) {
|
||||||
char m[MAX_MSG_LEN];
|
char m[MAX_MSG_LEN];
|
||||||
snprintf(m, sizeof(m), "%s left the chat!", nodesConnected[i].nick);
|
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)
|
for (int j = i; j < nodesCount-1; ++j)
|
||||||
nodesConnected[j] = nodesConnected[j+1];
|
nodesConnected[j] = nodesConnected[j+1];
|
||||||
|
|
@ -653,7 +655,9 @@ Touch is quirky and not recommended.
|
||||||
static void go_to_sleep() {
|
static void go_to_sleep() {
|
||||||
char m[MAX_MSG_LEN];
|
char m[MAX_MSG_LEN];
|
||||||
snprintf(m, sizeof(m), "%s left the chat!", currentNick);
|
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
|
delay(200); // let the packet fly
|
||||||
|
|
||||||
// Hold the backlight OFF pin through deep sleep so the screen stays dark.
|
// Hold the backlight OFF pin through deep sleep so the screen stays dark.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue