mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-06 12:06:58 +00:00
populate userProfile in more places
This commit is contained in:
parent
bd8cd8c4e4
commit
c9884a74fc
2 changed files with 21 additions and 6 deletions
|
@ -589,9 +589,24 @@ export class NoteEntityService implements OnModuleInit {
|
|||
id: In(targetNotesToFetch),
|
||||
},
|
||||
relations: {
|
||||
user: true,
|
||||
reply: true,
|
||||
renote: true,
|
||||
user: {
|
||||
userProfile: true,
|
||||
},
|
||||
reply: {
|
||||
user: {
|
||||
userProfile: true,
|
||||
},
|
||||
},
|
||||
renote: {
|
||||
user: {
|
||||
userProfile: true,
|
||||
},
|
||||
reply: {
|
||||
user: {
|
||||
userProfile: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
channel: true,
|
||||
},
|
||||
});
|
||||
|
|
|
@ -789,11 +789,11 @@ export class UserEntityService implements OnModuleInit {
|
|||
.map(user => user.host)
|
||||
.filter((host): host is string => host != null));
|
||||
|
||||
const _profiles: MiUserProfile[] = [];
|
||||
const _profilesFromUsers: MiUserProfile[] = [];
|
||||
const _profilesToFetch: string[] = [];
|
||||
for (const user of _users) {
|
||||
if (user.userProfile) {
|
||||
_profiles.push(user.userProfile);
|
||||
_profilesFromUsers.push(user.userProfile);
|
||||
} else {
|
||||
_profilesToFetch.push(user.id);
|
||||
}
|
||||
|
@ -805,7 +805,7 @@ export class UserEntityService implements OnModuleInit {
|
|||
// profilesMap
|
||||
this.cacheService.getUserProfiles(_profilesToFetch)
|
||||
.then(profiles => {
|
||||
for (const profile of _profiles) {
|
||||
for (const profile of _profilesFromUsers) {
|
||||
profiles.set(profile.userId, profile);
|
||||
}
|
||||
return profiles;
|
||||
|
|
Loading…
Add table
Reference in a new issue