Closed akhileshthite closed 5 months ago
When I created a new blog on Sutty and had it create a Fediverse account, I noticed that it required an approval for new followers.
Originally posted by @maisutton in hyphacoop/distributed-press-organizing#87 (comment)
For this change, in the ingestActivity
method, we should bypass moderation for Follow type activities and approve them directly, correct? Should I send a PR for this @RangerMauve?
async ingestActivity (fromActor: string, activity: APActivity): Promise<void> {
const activityId = activity.id
// TODO: handle array of string case and nested object
if (typeof activityId !== 'string') {
throw new Error('Activities must contain an ID')
}
const activityActor = activity.actor
// TODO: handle array of string case and nested object
if (typeof activityActor !== 'string') {
throw new Error('Activities must contain an actor string')
}
// Handle Follow activities by automatically approving them
if (activity.type === 'Follow') {
// No need for moderation, immediately approve the Follow activity
await this.approveActivity(fromActor, activityId)
} else {
// For all other activities, proceed with moderation
const mention = await this.actorToMention(activityActor)
const moderationState = await this.modCheck.check(mention, fromActor)
// Adding activity to the inbox should happen irrespective of moderation state
// TODO: trigger hooks
const actorStore = this.store.forActor(fromActor)
await actorStore.inbox.add(activity)
// Handle moderation states for other activities
if (moderationState === BLOCKED) {
await this.rejectActivity(fromActor, activityId)
} else if (moderationState === ALLOWED) {
await this.approveActivity(fromActor, activityId)
} else {
await this.hookSystem.dispatchModerationQueued(fromActor, activity)
}
}
}
IIRC @RangerMauve we talked about allowlisting every follow request (that's isn't superseded by the default blocklist) until we have a moderation queue interface implemented, is that correct?
I mean, we've been using the plugin without having to accept follow requests so far
Seems to be done?
When I created a new blog on Sutty and had it create a Fediverse account, I noticed that it required an approval for new followers.
Originally posted by @maisutton in https://github.com/hyphacoop/distributed-press-organizing/issues/87#issuecomment-1787765033