update AccountUpdateService
This commit is contained in:
parent
665c9dc38d
commit
b55b48d57e
|
@ -37,9 +37,12 @@ export class AccountUpdateService {
|
||||||
@bindThis
|
@bindThis
|
||||||
public async publishToFollowers(userId: MiUser['id']) {
|
public async publishToFollowers(userId: MiUser['id']) {
|
||||||
const user = await this.usersRepository.findOneBy({ id: userId });
|
const user = await this.usersRepository.findOneBy({ id: userId });
|
||||||
if (user == null) throw new Error('user not found');
|
if (user == null || user.isDeleted) {
|
||||||
|
// ユーザーが存在しない、または削除されている場合は何もしない
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 投稿者がローカルユーザーならUpdateを配信
|
// ローカルユーザーならUpdateを配信
|
||||||
if (this.userEntityService.isLocalUser(user)) {
|
if (this.userEntityService.isLocalUser(user)) {
|
||||||
const content = await this.createUpdatePersonActivity(user);
|
const content = await this.createUpdatePersonActivity(user);
|
||||||
this.apDeliverManagerService.deliverToFollowers(user, content);
|
this.apDeliverManagerService.deliverToFollowers(user, content);
|
||||||
|
@ -50,9 +53,12 @@ export class AccountUpdateService {
|
||||||
@bindThis
|
@bindThis
|
||||||
async publishToFollowersAndSharedInboxAndRelays(userId: MiUser['id']) {
|
async publishToFollowersAndSharedInboxAndRelays(userId: MiUser['id']) {
|
||||||
const user = await this.usersRepository.findOneBy({ id: userId });
|
const user = await this.usersRepository.findOneBy({ id: userId });
|
||||||
if (user == null) throw new Error('user not found');
|
if (user == null || user.isDeleted) {
|
||||||
|
// ユーザーが存在しない、または削除されている場合は何もしない
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 投稿者がローカルユーザーならUpdateを配信
|
// ローカルユーザーならUpdateを配信
|
||||||
if (this.userEntityService.isLocalUser(user)) {
|
if (this.userEntityService.isLocalUser(user)) {
|
||||||
const content = await this.createUpdatePersonActivity(user);
|
const content = await this.createUpdatePersonActivity(user);
|
||||||
const manager = this.apDeliverManagerService.createDeliverManager(user, content);
|
const manager = this.apDeliverManagerService.createDeliverManager(user, content);
|
||||||
|
|
Loading…
Reference in New Issue