gate group chats for under-18 users

Per the group chats spec, users under 18 cannot be added to or participate in
group chats. This wires up the client-side half:

- expose isUnder18 flag from the AA context (conservative default when
  birthdate is unknown)
- new restrictGroupChatSettings helper that writes
  allowGroupInvites: 'none' to the chat actor declaration, called on signup
  and on birthdate-update when the user is under 18
- hide the 'New group chat' entry in InitiateChatFlow for under-18 users
- lock the 'Allow group chat invites from' toggle to 'none' for under-18 in
  chat settings, with explanatory copy
- pass kind: 'direct' to listConvos for under-18 users so groups don't show
  in the requests inbox or count toward the unread/requests badges
This commit is contained in:
Samuel Newman
2026-05-19 17:06:16 +03:00
parent 49f8e5031f
commit 2199997c3e
8 changed files with 97 additions and 10 deletions
+6 -1
View File
@@ -43,6 +43,7 @@ import * as Layout from '#/components/Layout'
import {ListFooter} from '#/components/Lists'
import * as Toast from '#/components/Toast'
import {Text} from '#/components/Typography'
import {useAgeAssurance} from '#/ageAssurance'
import {IS_NATIVE} from '#/env'
import {RequestListItem} from './components/RequestListItem'
import {useIsWithinSplitView} from './components/splitView/context'
@@ -63,8 +64,12 @@ export function MessagesInboxScreen(props: Props) {
export function MessagesInboxScreenInner({}: Props) {
const {gtTablet} = useBreakpoints()
const aa = useAgeAssurance()
const listConvosQuery = useListConvosQuery({status: 'request'})
const listConvosQuery = useListConvosQuery({
status: 'request',
kind: aa.flags.isDeclaredUnderAdultAge ? 'direct' : 'all',
})
const {data} = listConvosQuery
const leftConvos = useLeftConvos()