Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions modular_doppler/verbs/code/do_checks.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
/mob/living/proc/doverb_checks(message)
if(!isnull(ckey) && is_banned_from(ckey, "Emote"))
to_chat(usr, span_boldwarning("You cannot send custom emotes (banned)."))
return FALSE

if(QDELETED(usr))
return FALSE

if(client && client.prefs.muted & MUTE_IC)
to_chat(usr, span_boldwarning("You cannot send IC messages (muted)."))
return FALSE

if(!length(message))
return FALSE

Expand All @@ -17,4 +28,27 @@
to_chat(usr, span_notice("You cannot send a Do in your current condition."))
return FALSE

var/list/filter_result = is_ic_filtered(message)

if(filter_result)
to_chat(usr, span_warning("That emote contained a word prohibited in IC emotes! Consider reviewing the server rules."))
to_chat(usr, span_warning("\"[message]\""))
REPORT_CHAT_FILTER_TO_USER(usr, filter_result)
log_filter("IC Emote", message, filter_result)
SSblackbox.record_feedback("tally", "ic_blocked_words", 1, LOWER_TEXT(config.ic_filter_regex.match))
return FALSE

filter_result = is_soft_ic_filtered(message)

if(filter_result)
if(tgui_alert(usr,"Your emote contains \"[filter_result[CHAT_FILTER_INDEX_WORD]]\". \"[filter_result[CHAT_FILTER_INDEX_REASON]]\", Are you sure you want to emote it?", "Soft Blocked Word", list("Yes", "No")) != "Yes")
SSblackbox.record_feedback("tally", "soft_ic_blocked_words", 1, LOWER_TEXT(config.soft_ic_filter_regex.match))
log_filter("Soft IC Emote", message, filter_result)
return FALSE

message_admins("[ADMIN_LOOKUPFLW(usr)] has passed the soft filter for do \"[filter_result[CHAT_FILTER_INDEX_WORD]]\" they may be using a disallowed term. Emote: \"[message]\"")
log_admin_private("[key_name(usr)] has passed the soft filter for do \"[filter_result[CHAT_FILTER_INDEX_WORD]]\" they may be using a disallowed term. Emote: \"[message]\"")
SSblackbox.record_feedback("tally", "passed_soft_ic_blocked_words", 1, LOWER_TEXT(config.soft_ic_filter_regex.match))
log_filter("Soft IC Emote (Passed)", message, filter_result)

return TRUE
3 changes: 0 additions & 3 deletions modular_doppler/verbs/code/do_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
if (!message || !doverb_checks(message))
return

if (!try_speak(message)) // ensure we pass the vibe check (filters, etc)
return

var/name_stub = " (<b>[usr]</b>)"
message = usr.apply_message_emphasis(message)
message = trim(copytext_char(message, 1, (MAX_MESSAGE_LEN - length(name_stub))))
Expand Down
Loading