From 5981a27817b5c745d484e83ff7e629f235044e45 Mon Sep 17 00:00:00 2001 From: Dpeta Date: Thu, 17 Nov 2022 11:34:17 +0100 Subject: [PATCH] Only send time on JOIN if time isn't CURRENT. CURRENT/'i' should be taken as the default anyway, and it's much much less spammy like this. With large memos it's very easy to trigger flood protection if every handle sends a TIME>i whenever someone joins. --- memos.py | 8 ++++++-- pesterchum.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/memos.py b/memos.py index 52d754d..a3af349 100644 --- a/memos.py +++ b/memos.py @@ -1732,8 +1732,12 @@ class PesterMemo(PesterConvo): elif update == "join": self.addUser(h) time = self.time.getTime() - serverText = "PESTERCHUM:TIME>" + delta2txt(time, "server") - self.messageSent.emit(serverText, self.title()) + txt_time = delta2txt(time, "server") + # Only send if time isn't CURRENT, it's very spammy otherwise. + # CURRENT should be the default already. + if txt_time != "i": + serverText = "PESTERCHUM:TIME>" + txt_time + self.messageSent.emit(serverText, self.title()) elif update == "+q": for c in chums: c.founder = True diff --git a/pesterchum.py b/pesterchum.py index d969325..5583002 100755 --- a/pesterchum.py +++ b/pesterchum.py @@ -2106,7 +2106,7 @@ class PesterWindow(MovingWindow): self.setChannelMode.emit(channel, "+s", "") if invite: self.setChannelMode.emit(channel, "+i", "") - memoWindow.sendTimeInfo() + # memoWindow.sendTimeInfo() memoWindow.show() def addChum(self, chum):