Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:saprkles: Auto escalate accounts for high follow/like churn #740

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
constants for review states
  • Loading branch information
bnewbold committed Sep 6, 2024
commit 35bcc47474cb3aa649b10b03f43efdbce9fca45c
9 changes: 8 additions & 1 deletion automod/engine/account_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import (
"github.com/bluesky-social/indigo/atproto/identity"
)

var (
ReviewStateEscalated = "escalated"
ReviewStateOpen = "open"
ReviewStateClosed = "closed"
ReviewStateNone = "none"
)

// information about a repo/account/identity, always pre-populated and relevant to many rules
type AccountMeta struct {
Identity *identity.Identity
Expand Down Expand Up @@ -34,7 +41,7 @@ type AccountPrivate struct {
EmailConfirmed bool
IndexedAt *time.Time
AccountTags []string
// ReviewState will be one of "open", "escalated", "closed", "none", or "" (unknown)
// ReviewState will be one of ReviewStateEscalated, ReviewStateOpen, ReviewStateClosed, ReviewStateNone, or "" (unknown)
ReviewState string
Appealed bool
}
8 changes: 4 additions & 4 deletions automod/engine/fetch_account_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ func (e *Engine) GetAccountMeta(ctx context.Context, ident *identity.Identity) (
if rd.Moderation.SubjectStatus.ReviewState != nil {
switch *rd.Moderation.SubjectStatus.ReviewState {
case "#reviewOpen":
ap.ReviewState = "open"
ap.ReviewState = ReviewStateOpen
case "#reviewEscalated":
ap.ReviewState = "escalated"
ap.ReviewState = ReviewStateEscalated
case "#reviewClosed":
ap.ReviewState = "closed"
ap.ReviewState = ReviewStateClosed
case "#reviewNonde":
ap.ReviewState = "none"
ap.ReviewState = ReviewStateNone
}
}
}
Expand Down