Skip to content

Commit

Permalink
automod: distinct mentions rule rename to be more neutral.
Browse files Browse the repository at this point in the history
A rule's name should describe what it does, not presumptively describe
the valence of what it hopes that it's detecting.
  • Loading branch information
warpfork committed Dec 18, 2023
1 parent c05826d commit 8d5de74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion automod/rules/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func DefaultRules() automod.RuleSet {
ReplySingleKeywordPostRule,
AggressivePromotionRule,
IdenticalReplyPostRule,
SpamMentionsRule,
DistinctMentionsRule,
},
ProfileRules: []automod.ProfileRuleFunc{
GtubeProfileRule,
Expand Down
6 changes: 3 additions & 3 deletions automod/rules/spammentions.go → automod/rules/mentions.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"github.com/bluesky-social/indigo/automod"
)

var _ automod.PostRuleFunc = SpamMentionsRule
var _ automod.PostRuleFunc = DistinctMentionsRule

var mentionHourlyThreshold = 20

// SpamMentionsRule looks for accounts which mention an unusually large number of distinct accounts per period.
func SpamMentionsRule(evt *automod.RecordEvent, post *appbsky.FeedPost) error {
// DistinctMentionsRule looks for accounts which mention an unusually large number of distinct accounts per period.
func DistinctMentionsRule(evt *automod.RecordEvent, post *appbsky.FeedPost) error {
did := evt.Account.Identity.DID.String()

// Increment counters for all new mentions in this post.
Expand Down

0 comments on commit 8d5de74

Please sign in to comment.