mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 20:44:34 +00:00
fix mixed-up userFollowingsCache / userFollowersCache
This commit is contained in:
parent
51572b7314
commit
ed766e98e1
2 changed files with 5 additions and 5 deletions
|
@ -113,7 +113,7 @@ class DeliverManager {
|
||||||
if (this.recipes.some(r => isFollowers(r))) {
|
if (this.recipes.some(r => isFollowers(r))) {
|
||||||
// followers deliver
|
// followers deliver
|
||||||
// ただ、sharedInboxがnullなリモートユーザーも稀におり、その対応ができなさそう?
|
// ただ、sharedInboxがnullなリモートユーザーも稀におり、その対応ができなさそう?
|
||||||
const followers = await this.cacheService.userFollowingsCache
|
const followers = await this.cacheService.userFollowersCache
|
||||||
.fetch(this.actor.id)
|
.fetch(this.actor.id)
|
||||||
.then(f => Array
|
.then(f => Array
|
||||||
.from(f.values())
|
.from(f.values())
|
||||||
|
|
|
@ -250,8 +250,8 @@ export class UserEntityService implements OnModuleInit {
|
||||||
@bindThis
|
@bindThis
|
||||||
public async getRelations(me: MiUser['id'], targets: MiUser['id'][]): Promise<Map<MiUser['id'], UserRelation>> {
|
public async getRelations(me: MiUser['id'], targets: MiUser['id'][]): Promise<Map<MiUser['id'], UserRelation>> {
|
||||||
const [
|
const [
|
||||||
followers,
|
myFollowing,
|
||||||
followees,
|
myFollowers,
|
||||||
followersRequests,
|
followersRequests,
|
||||||
followeesRequests,
|
followeesRequests,
|
||||||
blockers,
|
blockers,
|
||||||
|
@ -300,7 +300,7 @@ export class UserEntityService implements OnModuleInit {
|
||||||
|
|
||||||
return new Map(
|
return new Map(
|
||||||
targets.map(target => {
|
targets.map(target => {
|
||||||
const following = followers.get(target) ?? null;
|
const following = myFollowing.get(target) ?? null;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
target,
|
target,
|
||||||
|
@ -308,7 +308,7 @@ export class UserEntityService implements OnModuleInit {
|
||||||
id: target,
|
id: target,
|
||||||
following: following,
|
following: following,
|
||||||
isFollowing: following != null,
|
isFollowing: following != null,
|
||||||
isFollowed: followees.has(target),
|
isFollowed: myFollowers.has(target),
|
||||||
hasPendingFollowRequestFromYou: followersRequests.includes(target),
|
hasPendingFollowRequestFromYou: followersRequests.includes(target),
|
||||||
hasPendingFollowRequestToYou: followeesRequests.includes(target),
|
hasPendingFollowRequestToYou: followeesRequests.includes(target),
|
||||||
isBlocking: blockees.has(target),
|
isBlocking: blockees.has(target),
|
||||||
|
|
Loading…
Add table
Reference in a new issue