Adds the ability to soft filter words, also fixes some word filter bugs (#62158)

This commit is contained in:
NamelessFairy
2021-10-26 12:45:36 -07:00
committed by GitHub
parent 6e8872f178
commit 1238ce2373
27 changed files with 186 additions and 27 deletions
@@ -764,6 +764,13 @@ GLOBAL_LIST_EMPTY(PDAs)
REPORT_CHAT_FILTER_TO_USER(user, filter_result)
return
var/list/soft_filter_result = is_soft_ic_filtered_for_pdas(message)
if (soft_filter_result)
if(tgui_alert(usr,"Your message contains \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\". \"[soft_filter_result[CHAT_FILTER_INDEX_REASON]]\", Are you sure you want to send it?", "Soft Blocked Word", list("Yes", "No")) != "Yes")
return
message_admins("[ADMIN_LOOKUPFLW(usr)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\" they may be using a disallowed term in PDA messages. Message: \"[html_encode(message)]\"")
log_admin_private("[key_name(usr)] has passed the soft filter for \"[soft_filter_result[CHAT_FILTER_INDEX_WORD]]\" they may be using a disallowed term in PDA messages. Message: \"[message]\"")
if(prob(1))
message += "\nSent from my PDA"
// Send the signal