feat: mentions support

This commit is contained in:
Julian Lam
2024-03-05 14:24:13 -05:00
parent 1b64fdb5b3
commit e4c1ca1ede
6 changed files with 73 additions and 25 deletions

View File

@@ -111,11 +111,8 @@ User.getUidByUserslug = async function (userslug) {
return 0;
}
// fix this! Forces a remote call, this is bad. Should be done in actors.assert
// then mentions. should return actor uri or url or something to parsePost.
if (userslug.includes('@')) {
const { actorUri } = await activitypub.helpers.query(userslug);
return actorUri;
return (await db.getObjectField('handle:uid', userslug)) || 0;
}
return await db.sortedSetScore('userslug:uid', userslug);