Skip to main content

max / makenotwork

1.2 KB · 23 lines History Blame Raw
1 -- Per-community chat write/read policy.
2 --
3 -- Modes (see mt-core `ChatPolicy`, wiki livechat-design "Write policy"):
4 -- off: no route, no hub room, no UI affordance. Nobody reads, nobody writes.
5 -- members: anyone who can view the forum reads; members in good standing write.
6 -- public_read: anyone reads, including logged out; members in good standing write.
7 -- fan_plus: anyone who can view the forum reads; Fan+ writes.
8 --
9 -- "Members in good standing" is the existing `check_write_access` gate: not
10 -- suspended, not banned, not muted. Read visibility above is on top of whatever
11 -- the community itself already allows; chat never widens forum access.
12 --
13 -- Default is `off` for existing communities too, which is what the column
14 -- default backfills here. Chat is a live moderation burden and enabling it
15 -- silently would hand every owner a surface they never asked to carry.
16 --
17 -- Frozen and Archived communities are read-only for chat regardless of this
18 -- column, matching `CommunityState::allows_writes_for_members()`.
19
20 ALTER TABLE communities
21 ADD COLUMN chat_policy TEXT NOT NULL DEFAULT 'off'
22 CHECK (chat_policy IN ('off', 'members', 'public_read', 'fan_plus'));
23