forked from FoundKeyGang/FoundKey
send reject follow if federateBlocks is false
This commit is contained in:
parent
b4a83bea38
commit
9c9b5bb44c
1 changed files with 9 additions and 3 deletions
|
@ -11,6 +11,7 @@ import { Blockings, Users, FollowRequests, Followings, UserListJoinings, UserLis
|
|||
import { perUserFollowingChart } from '@/services/chart/index.js';
|
||||
import { genId } from '@/misc/gen-id.js';
|
||||
import { getActiveWebhooks } from '@/misc/webhook-cache.js';
|
||||
import { rejectFollow } from '../following/reject.js';
|
||||
|
||||
export default async function(blocker: User, blockee: User) {
|
||||
await Promise.all([
|
||||
|
@ -32,9 +33,14 @@ export default async function(blocker: User, blockee: User) {
|
|||
|
||||
await Blockings.insert(blocking);
|
||||
|
||||
if (Users.isLocalUser(blocker) && Users.isRemoteUser(blockee) && blocker.federateBlocks) {
|
||||
if (Users.isLocalUser(blocker) && Users.isRemoteUser(blockee)) {
|
||||
if (blocker.federateBlocks) {
|
||||
const content = renderActivity(renderBlock(blocking));
|
||||
deliver(blocker, content, blockee.inbox);
|
||||
} else {
|
||||
// Send a Reject Follow activity to the user being blocked to prevent them from reading follower-only posts.
|
||||
rejectFollow(blocker, blockee);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue