[backend] Update user profile mentions on createPerson and updatePerson

This commit is contained in:
Laura Hausmann 2023-10-15 22:26:51 +02:00
parent 82e0ef7414
commit 75c9873796
No known key found for this signature in database
GPG Key ID: D044E84C5BE01605
2 changed files with 7 additions and 1 deletions

View File

@ -386,6 +386,9 @@ export async function createPerson(
// Hashtag update // Hashtag update
updateUsertags(user!, tags); updateUsertags(user!, tags);
// Mentions update
await UserProfiles.updateMentions(user!.id);
//#region Fetch avatar and header image //#region Fetch avatar and header image
const [avatar, banner] = await Promise.all( const [avatar, banner] = await Promise.all(
[person.icon, person.image].map((img) => [person.icon, person.image].map((img) =>
@ -603,6 +606,9 @@ export async function updatePerson(
// Hashtag Update // Hashtag Update
updateUsertags(user, tags); updateUsertags(user, tags);
// Mentions update
await UserProfiles.updateMentions(user!.id);
// If the user in question is a follower, followers will also be updated. // If the user in question is a follower, followers will also be updated.
await Followings.update( await Followings.update(
{ {

View File

@ -102,7 +102,7 @@ export async function resolveUser(
return await createPerson(fingerRes.self.href, undefined, subjectHost); return await createPerson(fingerRes.self.href, undefined, subjectHost);
} }
// If user information is out of date, return it by starting over from WebFilger // If user information is out of date, return it by starting over from WebFinger
if ( if (
refresh && ( refresh && (
user.lastFetchedAt == null || user.lastFetchedAt == null ||