[Chat] Handle moderation lock override in group chats (#10835)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-06-10 21:57:12 +03:00
committed by GitHub
parent 3b5ede37f7
commit 8db30c7d31
8 changed files with 62 additions and 16 deletions
@@ -3,6 +3,7 @@ import {Pressable, View} from 'react-native'
import {
ChatBskyActorDefs,
ChatBskyConvoDefs,
ChatBskyConvoUnlockConvo,
type ModerationOpts,
} from '@atproto/api'
import {Trans, useLingui} from '@lingui/react/macro'
@@ -417,6 +418,12 @@ function SettingsHeader({
if (lock) {
logger.error('Failed to lock group chat', {message: e})
Toast.show(l`Failed to lock group chat`, {type: 'error'})
} else if (
e instanceof ChatBskyConvoUnlockConvo.ConvoLockedByModerationError
) {
Toast.show(l`This chat is locked by a moderation action`, {
type: 'error',
})
} else {
logger.error('Failed to unlock group chat', {message: e})
Toast.show(l`Failed to unlock group chat`, {type: 'error'})
@@ -447,7 +454,11 @@ function SettingsHeader({
const createdAt = new Date(convo.details.createdAt)
const canLockGroupChat = isOwner && lockStatus !== 'locked-permanently'
// A lock forced by a moderation action cannot be undone by the owner.
const canLockGroupChat =
isOwner &&
lockStatus !== 'locked-permanently' &&
!convo.details.lockStatusModerationOverride
const groupNameComponent = (
<Text