Revert "update"

This reverts commit 55c80db66d.
This commit is contained in:
mattyatea 2024-05-11 01:16:47 +09:00
parent 55c80db66d
commit bc3234510c
6 changed files with 25 additions and 25 deletions

View file

@ -477,6 +477,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const updatedProfile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
await this.cacheService.userProfileCache.set(user.id, updatedProfile);
// Publish meUpdated event
this.globalEventService.publishMainStream(user.id, 'meUpdated', iObj);

View file

@ -4,7 +4,6 @@
*/
import * as WebSocket from 'ws';
import { Inject } from '@nestjs/common';
import type { MiUser } from '@/models/User.js';
import type { MiAccessToken } from '@/models/AccessToken.js';
import type { Packed } from '@/misc/json-schema.js';
@ -12,10 +11,9 @@ import type { NoteReadService } from '@/core/NoteReadService.js';
import type { NotificationService } from '@/core/NotificationService.js';
import { bindThis } from '@/decorators.js';
import { CacheService } from '@/core/CacheService.js';
import { MiFollowing, MiUserProfile, type UserProfilesRepository } from '@/models/_.js';
import { MiFollowing, MiUserProfile } from '@/models/_.js';
import type { StreamEventEmitter, GlobalEvents } from '@/core/GlobalEventService.js';
import { ChannelFollowingService } from '@/core/ChannelFollowingService.js';
import { DI } from '@/di-symbols.js';
import type { ChannelsService } from './ChannelsService.js';
import type { EventEmitter } from 'events';
import type Channel from './channel.js';
@ -47,8 +45,7 @@ export default class Connection {
private notificationService: NotificationService,
private cacheService: CacheService,
private channelFollowingService: ChannelFollowingService,
@Inject(DI.userProfilesRepository)
private userProfilesRepository: UserProfilesRepository,
user: MiUser | null | undefined,
token: MiAccessToken | null | undefined,
) {
@ -60,7 +57,7 @@ export default class Connection {
public async fetch() {
if (this.user == null) return;
const [userProfile, following, followingChannels, userIdsWhoMeMuting, userIdsWhoBlockingMe, userIdsWhoMeMutingRenotes] = await Promise.all([
await this.userProfilesRepository.findOneByOrFail({ userId: this.user.id }),
this.cacheService.userProfileCache.fetch(this.user.id),
this.cacheService.userFollowingsCache.fetch(this.user.id),
this.channelFollowingService.userFollowingChannelsCache.fetch(this.user.id),
this.cacheService.userMutingsCache.fetch(this.user.id),