mirror of
https://github.com/Aurorastation/Aurora-Old.git
synced 2026-07-20 12:12:20 +01:00
Fixing Spam Prevention
Links the spam prevention to verbs, and removes the proc references. This way, automatic emotes do not cause them to be triggered.
This commit is contained in:
@@ -15,7 +15,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
|
||||
if(prefs.muted & MUTE_ADMINHELP)
|
||||
src << "<font color='red'>Error: Admin-PM: You cannot send adminhelps (Muted).</font>"
|
||||
return
|
||||
if(src.handle_spam_prevention(msg,MUTE_ADMINHELP))
|
||||
if(src.handle_spam_prevention(msg,MUTE_ADMINHELP,0))
|
||||
return
|
||||
|
||||
adminhelped = 2 //Determines if they get the message to reply by clicking the name.
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
else adminhelp(msg) //admin we are replying to has vanished, adminhelp instead
|
||||
return
|
||||
|
||||
if (src.handle_spam_prevention(msg,MUTE_ADMINHELP))
|
||||
if (src.handle_spam_prevention(msg,MUTE_ADMINHELP,0))
|
||||
return
|
||||
|
||||
//clean the message if it's not sent by a high-rank admin
|
||||
@@ -161,4 +161,3 @@
|
||||
continue
|
||||
if(X.holder.rights & (R_ADMIN|R_MOD))
|
||||
X << "<B><font color='blue'>PM: [key_name(src, X, 0)]->IRC-Admins:</B> \blue [msg]</font>"
|
||||
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
src << "\red You have deadchat muted."
|
||||
return
|
||||
|
||||
if (src.handle_spam_prevention(msg,MUTE_DEADCHAT))
|
||||
return
|
||||
|
||||
var/stafftype = null
|
||||
|
||||
if (src.holder.rights & R_MOD)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
if(usr.client.prefs.muted & MUTE_PRAY)
|
||||
usr << "\red You cannot pray (muted)."
|
||||
return
|
||||
if(src.client.handle_spam_prevention(msg,MUTE_PRAY))
|
||||
if(src.client.handle_spam_prevention(msg,MUTE_PRAY,0))
|
||||
return
|
||||
|
||||
var/image/cross = image('icons/obj/storage.dmi',"bible")
|
||||
@@ -58,4 +58,4 @@
|
||||
msg = "\blue <b><font color=crimson>SYNDICATE:</font>[key_name(Sender, 1)] (<A HREF='?_src_=holder;adminplayeropts=\ref[Sender]'>PP</A>) (<A HREF='?_src_=vars;Vars=\ref[Sender]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=\ref[Sender]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=\ref[Sender]'>JMP</A>) (<A HREF='?_src_=holder;secretsadmin=check_antagonist'>CA</A>) (<A HREF='?_src_=holder;BlueSpaceArtillery=\ref[Sender]'>BSA</A>) (<A HREF='?_src_=holder;SyndicateReply=\ref[Sender]'>RPLY</A>):</b> [msg]"
|
||||
for(var/client/C in admins)
|
||||
if(C.holder.rights & (R_ADMIN|R_MOD|R_FUN))
|
||||
C << msg
|
||||
C << msg
|
||||
|
||||
@@ -89,7 +89,9 @@
|
||||
|
||||
..() //redirect to hsrc.Topic()
|
||||
|
||||
/client/proc/handle_spam_prevention(var/message, var/mute_type)
|
||||
/client/proc/handle_spam_prevention(var/message, var/mute_type, var/pass = 1)
|
||||
if (pass)
|
||||
return 0
|
||||
if(config.automute_on && !holder)
|
||||
if(src.last_message_time > world.time - SPAM_TIMER * 10)
|
||||
if(src.last_message_timer > SPAM_TRIGGER_AUTOMUTE)
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
src << "\red You cannot talk in deadchat (muted)."
|
||||
return
|
||||
|
||||
if (src.client.handle_spam_prevention(message,MUTE_DEADCHAT))
|
||||
return
|
||||
|
||||
. = src.say_dead(message)
|
||||
|
||||
|
||||
@@ -33,9 +30,6 @@
|
||||
src << "\red You cannot emote in deadchat (muted)."
|
||||
return
|
||||
|
||||
if(src.client.handle_spam_prevention(message, MUTE_DEADCHAT))
|
||||
return
|
||||
|
||||
. = src.emote_dead(message)
|
||||
|
||||
/*
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
if (client.prefs.muted & MUTE_IC)
|
||||
src << "\red You cannot send IC messages (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
if (stat)
|
||||
return
|
||||
if(!(message))
|
||||
@@ -124,4 +122,4 @@
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message(message, m_type)
|
||||
//Foreach goto(746)
|
||||
return
|
||||
return
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
if (client.prefs.muted & MUTE_IC)
|
||||
src << "\red You cannot send IC messages (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
if (stat)
|
||||
return
|
||||
if(!(message))
|
||||
@@ -132,4 +130,4 @@
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message(message, m_type)
|
||||
//Foreach goto(746)
|
||||
return
|
||||
return
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
if (client.prefs.muted & MUTE_IC)
|
||||
src << "\red You cannot send IC messages (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
if (stat)
|
||||
return
|
||||
if(!(message))
|
||||
@@ -124,4 +122,4 @@
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message(message, m_type)
|
||||
//Foreach goto(746)
|
||||
return
|
||||
return
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
if (client.prefs.muted & MUTE_IC)
|
||||
src << "\red You cannot send IC messages (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
if (stat)
|
||||
return
|
||||
if(!(message))
|
||||
@@ -79,4 +77,4 @@
|
||||
O.show_message(message, m_type)
|
||||
else if (m_type & 2)
|
||||
for (var/mob/O in hearers(src.loc, null))
|
||||
O.show_message(message, m_type)
|
||||
O.show_message(message, m_type)
|
||||
|
||||
@@ -74,8 +74,6 @@
|
||||
if (client.prefs.muted & MUTE_IC)
|
||||
src << "\red You cannot send IC messages (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
if (stat)
|
||||
return
|
||||
if(!(message))
|
||||
@@ -618,4 +616,4 @@
|
||||
HTML += "<hr />"
|
||||
HTML +="<a href='?src=\ref[src];flavor_change=done'>\[Done\]</a>"
|
||||
HTML += "<tt>"
|
||||
src << browse(HTML, "window=flavor_changes;size=430x300")
|
||||
src << browse(HTML, "window=flavor_changes;size=430x300")
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
if (src.client.prefs.muted & MUTE_IC)
|
||||
src << "\red You cannot whisper (muted)."
|
||||
return
|
||||
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
if (client.handle_spam_prevention(message, MUTE_IC, 0))
|
||||
return
|
||||
|
||||
if (src.stat == 2)
|
||||
@@ -78,12 +77,12 @@
|
||||
temp_message[H] = ninjaspeak(temp_message[H])
|
||||
pick_list -= H
|
||||
message = list2text(temp_message, " ")
|
||||
message = replacetext(message, "o", "¤")
|
||||
message = replacetext(message, "p", "þ")
|
||||
message = replacetext(message, "l", "£")
|
||||
message = replacetext(message, "s", "§")
|
||||
message = replacetext(message, "u", "µ")
|
||||
message = replacetext(message, "b", "ß")
|
||||
message = replacetext(message, "o", "�")
|
||||
message = replacetext(message, "p", "�")
|
||||
message = replacetext(message, "l", "�")
|
||||
message = replacetext(message, "s", "�")
|
||||
message = replacetext(message, "u", "�")
|
||||
message = replacetext(message, "b", "�")
|
||||
|
||||
//TODO: handle_speech_problems
|
||||
if (src.stuttering)
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
if (client.prefs.muted & MUTE_IC)
|
||||
src << "\red You cannot send IC messages (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
if (stat)
|
||||
return
|
||||
if(!(message))
|
||||
@@ -73,4 +71,4 @@
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message(message, m_type)
|
||||
//Foreach goto(746)
|
||||
return
|
||||
return
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
if (client.prefs.muted & MUTE_IC)
|
||||
src << "\red You cannot send IC messages (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
if (stat)
|
||||
return
|
||||
if(!(message))
|
||||
@@ -137,4 +135,4 @@
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message(message, m_type)
|
||||
//Foreach goto(746)
|
||||
return
|
||||
return
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
if(client.prefs.muted & MUTE_IC)
|
||||
src << "You cannot send IC messages (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
if (stat)
|
||||
return
|
||||
if(!(message))
|
||||
@@ -99,4 +97,4 @@
|
||||
else
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message(message, m_type)
|
||||
return
|
||||
return
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
if(client.prefs.muted & MUTE_IC)
|
||||
src << "You cannot send IC messages (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
if (stat)
|
||||
return
|
||||
if(!(message))
|
||||
@@ -217,4 +215,4 @@
|
||||
else
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message(message, m_type)
|
||||
return
|
||||
return
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
if(client.prefs.muted & MUTE_IC)
|
||||
src << "You cannot send IC messages (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
|
||||
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
if(client.prefs.muted & MUTE_IC)
|
||||
src << "\red You cannot speak in IC (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
|
||||
if(istype(src.loc,/mob/living/simple_animal/borer))
|
||||
|
||||
@@ -135,8 +133,6 @@
|
||||
if(client.prefs.muted & MUTE_IC)
|
||||
src << "\red You cannot speak in IC (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
|
||||
if (copytext(message, 1, 2) == "*")
|
||||
return emote(copytext(message, 2))
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
if(client.prefs.muted & MUTE_IC)
|
||||
src << "\red You cannot speak in IC (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
|
||||
if(istype(src.loc,/mob/living/simple_animal/borer))
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
if(client.prefs.muted & MUTE_IC)
|
||||
src << "\red You cannot speak in IC (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
|
||||
if (copytext(message, 1, 2) == "*")
|
||||
return emote(copytext(message, 2))
|
||||
@@ -39,4 +37,4 @@
|
||||
if (istype(M, /mob/new_player))
|
||||
continue
|
||||
else if(M.stat == 2 && M.client.prefs.toggles & CHAT_GHOSTEARS)
|
||||
M << "[src.truename] whispers to [host], \"[message]\""
|
||||
M << "[src.truename] whispers to [host], \"[message]\""
|
||||
|
||||
@@ -12,6 +12,15 @@
|
||||
if(say_disabled) //This is here to try to identify lag problems
|
||||
usr << "\red Speech is currently admin-disabled."
|
||||
return
|
||||
|
||||
if (client)
|
||||
if (istype(src, /mob/dead/observer))
|
||||
if (client.handle_spam_prevention(message, MUTE_DEADCHAT, 0))
|
||||
return
|
||||
else
|
||||
if (client.handle_spam_prevention(message, MUTE_IC, 0))
|
||||
return
|
||||
|
||||
//Let's try to make users fix their errors - we try to detect single, out-of-place letters and 'unintended' words
|
||||
/*
|
||||
var/first_letter = copytext(message,1,2)
|
||||
@@ -37,6 +46,14 @@
|
||||
usr << "\red Speech is currently admin-disabled."
|
||||
return
|
||||
|
||||
if (client)
|
||||
if (istype(src, /mob/dead/observer))
|
||||
if (client.handle_spam_prevention(message, MUTE_DEADCHAT, 0))
|
||||
return
|
||||
else
|
||||
if (client.handle_spam_prevention(message, MUTE_IC, 0))
|
||||
return
|
||||
|
||||
message = strip_html_properly(message)
|
||||
//We do not have typing indicator code yet - Waiting for the okay from Skull before considering adding - Jamini
|
||||
// set_typing_indicator(0)
|
||||
|
||||
Reference in New Issue
Block a user