From 34c3e7fb8a9ab41ee08132908153e1551887b93d Mon Sep 17 00:00:00 2001 From: Markolie Date: Tue, 8 Nov 2016 17:08:52 +0100 Subject: [PATCH] Prioritize throttle, better admin right check --- code/modules/client/client procs.dm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index b13fd42c38e..17c454bb7e2 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -234,7 +234,13 @@ return 1 /client/proc/handle_spam_prevention(var/message, var/mute_type, var/throttle = 0) - if(config.automute_on && !holder && last_message == message) + if(throttle) + if((last_message_time + throttle > world.time) && !check_rights(R_ADMIN, 0)) + var/wait_time = round(((last_message_time + throttle) - world.time) / 10, 1) + to_chat(src, "You are sending messages to quickly. Please wait [wait_time] [wait_time == 1 ? "second" : "seconds"] before sending another message.") + return 1 + last_message_time = world.time + if(config.automute_on && !check_rights(R_ADMIN, 0) && last_message == message) last_message_count++ if(last_message_count >= SPAM_TRIGGER_AUTOMUTE) to_chat(src, "You have exceeded the spam filter limit for identical messages. An auto-mute was applied.") @@ -243,12 +249,6 @@ if(last_message_count >= SPAM_TRIGGER_WARNING) to_chat(src, "You are nearing the spam filter limit for identical messages.") return 0 - else if(throttle) - if((last_message_time + throttle > world.time) && !check_rights(R_ADMIN, 0)) - var/wait_time = round(((last_message_time + throttle) - world.time) / 10, 1) - to_chat(src, "You are sending messages to quickly. Please wait [wait_time] [wait_time == 1 ? "second" : "seconds"] before sending another message.") - return 1 - last_message_time = world.time else last_message = message last_message_count = 0