fix user suspension / unsuspension not updating caches

This commit is contained in:
Hazelnoot 2025-07-23 16:10:00 -04:00 committed by dakkar
parent f937f2d3c6
commit 73f2ee4fb3

View file

@ -21,6 +21,7 @@ import { LoggerService } from '@/core/LoggerService.js';
import type Logger from '@/logger.js';
import { renderInlineError } from '@/misc/render-inline-error.js';
import { trackPromise } from '@/misc/promise-tracker.js';
import { InternalEventService } from '@/core/InternalEventService.js';
@Injectable()
export class UserSuspendService {
@ -42,6 +43,7 @@ export class UserSuspendService {
private apRendererService: ApRendererService,
private moderationLogService: ModerationLogService,
private readonly cacheService: CacheService,
private readonly internalEventService: InternalEventService,
loggerService: LoggerService,
) {
@ -56,6 +58,8 @@ export class UserSuspendService {
isSuspended: true,
});
await this.internalEventService.emit(user.host == null ? 'localUserUpdated' : 'remoteUserUpdated', { id: user.id });
await this.moderationLogService.log(moderator, 'suspend', {
userId: user.id,
userUsername: user.username,
@ -74,6 +78,8 @@ export class UserSuspendService {
isSuspended: false,
});
await this.internalEventService.emit(user.host == null ? 'localUserUpdated' : 'remoteUserUpdated', { id: user.id });
await this.moderationLogService.log(moderator, 'unsuspend', {
userId: user.id,
userUsername: user.username,