Merge branch 'sync' into 'develop'

Sync the user on verify_credentials

Closes #11

See merge request soapbox-pub/ditto!17
This commit is contained in:
Alex Gleason
2023-08-19 19:09:09 +00:00
2 changed files with 22 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ import { type AppController } from '@/app.ts';
import { type Filter, findReplyTag, z } from '@/deps.ts';
import * as mixer from '@/mixer.ts';
import * as pipeline from '@/pipeline.ts';
import { getAuthor, getFollows } from '@/queries.ts';
import { getAuthor, getFollows, syncUser } from '@/queries.ts';
import { booleanParamSchema } from '@/schema.ts';
import { jsonMetaContentSchema } from '@/schemas/nostr.ts';
import { signEvent } from '@/sign.ts';
@@ -18,6 +18,8 @@ const createAccountController: AppController = (c) => {
const verifyCredentialsController: AppController = async (c) => {
const pubkey = c.get('pubkey')!;
await syncUser(pubkey);
const event = await getAuthor(pubkey);
if (event) {
return c.json(await toAccount(event, { withSource: true }));