Add delay to whitelist warning message to prevent spamming

This commit is contained in:
q 2024-04-27 15:02:42 -04:00
parent 49b80f6323
commit e89c970053

View File

@ -131,7 +131,7 @@ Searxng.prototype.handleMessage = function(event, room) {
const currentTime = Date.now();
if (isNaN(lastRoomWarningTime) || (Date.now() - lastRoomWarningTime) > 10000) {
if (isNaN(lastRoomWarningTime) || (currentTime - lastRoomWarningTime) > 10000) {
this.matrixClient.sendNotice(room.roomId, "You are not on the whitelist for this room.");
lastWarningTimes.set(room.roomId, currentTime);
}