about summary refs log tree commit diff
path: root/src/state/session
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/session')
-rw-r--r--src/state/session/agent.ts10
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, {