diff options
author | Eric Bailey <git@esb.lol> | 2024-05-17 15:38:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-17 15:38:47 -0500 |
commit | 1b47ea7367c7d0f37557d8f07329c3b6f97a5e03 (patch) | |
tree | 4d738b08b30bbf914855b48ae31ff951faee9fae /src/state/session | |
parent | cef243bcf47235b16f0dba54c917fb8c37757c96 (diff) | |
download | voidsky-1b47ea7367c7d0f37557d8f07329c3b6f97a5e03.tar.zst |
Set chat declaration upon signup (#4084)
Diffstat (limited to 'src/state/session')
-rw-r--r-- | src/state/session/agent.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/state/session/agent.ts b/src/state/session/agent.ts index 9633dc0e3..3de4cad26 100644 --- a/src/state/session/agent.ts +++ b/src/state/session/agent.ts @@ -9,6 +9,7 @@ import { TIMELINE_SAVED_FEED, } from '#/lib/constants' import {tryFetchGates} from '#/lib/statsig/statsig' +import {getAge} from '#/lib/strings/time' import {logger} from '#/logger' import { configureModerationForAccount, @@ -153,6 +154,15 @@ export async function createAgentAndCreateAccount( id: TID.nextStr(), }, ]) + await agent.api.com.atproto.repo.putRecord({ + repo: account.did, + collection: 'chat.bsky.actor.declaration', + rkey: 'self', + record: { + $type: 'chat.bsky.actor.declaration', + allowIncoming: getAge(birthDate) < 18 ? 'none' : 'following', + }, + }) }) } catch (e: any) { logger.error(e, { |