feat: add more options for when to make proxied messages silent

This commit is contained in:
Petal Ladenson 2026-01-13 19:26:10 -07:00
parent 952bb02285
commit 546a287c28
9 changed files with 71 additions and 14 deletions

View file

@ -27,7 +27,7 @@ create function message_context(account_id bigint, guild_id bigint, channel_id b
in_log_blacklist bool,
log_cleanup_enabled bool,
require_system_tag bool,
suppress_notifications bool,
suppress_notifications int,
deny_bot_usage bool
)
@ -68,7 +68,7 @@ as $$
or (thread_id = any (servers.log_blacklist))) as in_log_blacklist,
coalesce(servers.log_cleanup_enabled, false) as log_cleanup_enabled,
coalesce(servers.require_system_tag, false) as require_system_tag,
coalesce(servers.suppress_notifications, false) as suppress_notifications,
coalesce(servers.suppress_notifications, 0) as suppress_notifications,
-- abuse_logs table
coalesce(abuse_logs.deny_bot_usage, false) as deny_bot_usage

View file

@ -0,0 +1,11 @@
-- database version 54
-- change suppress notifications server config to an enum
alter table servers
alter column suppress_notifications drop default,
alter column suppress_notifications type int
using case when suppress_notifications then 1 else 0 end,
alter column suppress_notifications set default 0,
add constraint suppress_notifications_check check (suppress_notifications = ANY (ARRAY[0,1,2,3]));
update info set schema_version = 54;