summaryrefslogtreecommitdiff
path: root/packages/backend/src
diff options
context:
space:
mode:
authoratsuchan <83960488+atsu1125@users.noreply.github.com>2022-12-26 17:05:44 +0900
committerGitHub <noreply@github.com>2022-12-26 17:05:44 +0900
commit50e3839b60f6c48296f650565d2f0b8c1de0178f (patch)
tree28cc70ee671565aaecbb31dd8eed2d97d713618f /packages/backend/src
parentfeat: introduce fluent emoji (diff)
downloadsharkey-50e3839b60f6c48296f650565d2f0b8c1de0178f.tar.gz
sharkey-50e3839b60f6c48296f650565d2f0b8c1de0178f.tar.bz2
sharkey-50e3839b60f6c48296f650565d2f0b8c1de0178f.zip
Fix: Block delivery (#9397)
* Fix: Block delivery * Fix: Block delivery -
Diffstat (limited to 'packages/backend/src')
-rw-r--r--packages/backend/src/core/UserBlockingService.ts16
1 files changed, 11 insertions, 5 deletions
diff --git a/packages/backend/src/core/UserBlockingService.ts b/packages/backend/src/core/UserBlockingService.ts
index d411768dc7..c923700427 100644
--- a/packages/backend/src/core/UserBlockingService.ts
+++ b/packages/backend/src/core/UserBlockingService.ts
@@ -169,6 +169,12 @@ export class UserBlockingService {
const content = this.apRendererService.renderActivity(this.apRendererService.renderUndo(this.apRendererService.renderFollow(follower, followee), follower));
this.queueService.deliver(follower, content, followee.inbox);
}
+
+ // リモートからフォローをされていたらRejectFollow送信
+ if (this.userEntityService.isLocalUser(followee) && this.userEntityService.isRemoteUser(follower)) {
+ const content = this.apRendererService.renderActivity(this.apRendererService.renderReject(this.apRendererService.renderFollow(follower, followee), followee));
+ this.queueService.deliver(followee, content, follower.inbox);
+ }
}
@bindThis
@@ -191,23 +197,23 @@ export class UserBlockingService {
blockerId: blocker.id,
blockeeId: blockee.id,
});
-
+
if (blocking == null) {
this.logger.warn('ブロック解除がリクエストされましたがブロックしていませんでした');
return;
}
-
+
// Since we already have the blocker and blockee, we do not need to fetch
// them in the query above and can just manually insert them here.
blocking.blocker = blocker;
blocking.blockee = blockee;
-
+
await this.blockingsRepository.delete(blocking.id);
-
+
// deliver if remote bloking
if (this.userEntityService.isLocalUser(blocker) && this.userEntityService.isRemoteUser(blockee)) {
const content = this.apRendererService.renderActivity(this.apRendererService.renderUndo(this.apRendererService.renderBlock(blocking), blocker));
this.queueService.deliver(blocker, content, blockee.inbox);
}
- }
+ }
}