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.
This commit is contained in:
Dpeta 2022-11-17 11:34:17 +01:00
parent 16625ba936
commit 5981a27817
2 changed files with 7 additions and 3 deletions

View file

@ -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

View file

@ -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):