-
Notifications
You must be signed in to change notification settings - Fork 580
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement quote-post moderation handling
- Loading branch information
Showing
10 changed files
with
446 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
import { ModerationDecision } from '../decision' | ||
import { ModerationSubjectFeedGenerator, ModerationOpts } from '../types' | ||
import { decideAccount } from './account' | ||
import { decideProfile } from './profile' | ||
|
||
export function decideFeedGenerator( | ||
_subject: ModerationSubjectFeedGenerator, | ||
_opts: ModerationOpts, | ||
subject: ModerationSubjectFeedGenerator, | ||
opts: ModerationOpts, | ||
): ModerationDecision { | ||
// TODO handle labels applied on the feed generator itself | ||
return new ModerationDecision() | ||
return ModerationDecision.merge( | ||
decideAccount(subject.creator, opts), | ||
decideProfile(subject.creator, opts), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
import { AppBskyActorDefs } from '../../client/index' | ||
import { ModerationDecision } from '../decision' | ||
import { ModerationSubjectUserList, ModerationOpts } from '../types' | ||
import { decideAccount } from './account' | ||
import { decideProfile } from './profile' | ||
|
||
export function decideUserList( | ||
_subject: ModerationSubjectUserList, | ||
_opts: ModerationOpts, | ||
subject: ModerationSubjectUserList, | ||
opts: ModerationOpts, | ||
): ModerationDecision { | ||
// TODO handle labels applied on the list itself | ||
return new ModerationDecision() | ||
const account = AppBskyActorDefs.isProfileViewBasic(subject.creator) | ||
? decideAccount(subject.creator, opts) | ||
: new ModerationDecision() | ||
const profile = AppBskyActorDefs.isProfileViewBasic(subject.creator) | ||
? decideProfile(subject.creator, opts) | ||
: new ModerationDecision() | ||
return ModerationDecision.merge(account, profile) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.