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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user