Skip to content

Commit

Permalink
🧹 Cleanup unnecessary hashtag rule
Browse files Browse the repository at this point in the history
  • Loading branch information
foysalit committed Oct 15, 2024
1 parent 4bd2cf4 commit 40079e3
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions automod/rules/hashtags.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ import (

// looks for specific hashtags from known lists
func BadHashtagsPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error {
// In cases where we have a soft signaling hashtag that are problematic in combination with other hashtags
// we'd want to check the record contains the combination before taking any action
potentiallyBadHashtags := []string{}
potentiallyBadHashtagCombo := []string{}

for _, tag := range ExtractHashtagsPost(post) {
tag = NormalizeHashtag(tag)
// skip some bad-word hashtags which frequently false-positive
Expand All @@ -24,16 +19,6 @@ func BadHashtagsPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
if c.InSet("bad-hashtags", tag) || c.InSet("bad-words", tag) {
c.AddRecordFlag("bad-hashtag")
c.ReportRecord(automod.ReportReasonRude, fmt.Sprintf("possible bad word in hashtags: %s", tag))

if c.InSet("potentially-bad-hashtags", tag) {
potentiallyBadHashtags = append(potentiallyBadHashtags, tag)
break
}
if c.InSet("potentially-bad-hashtag-combos", tag) {
potentiallyBadHashtagCombo = append(potentiallyBadHashtagCombo, tag)
break
}

break
}
word := keyword.SlugContainsExplicitSlur(keyword.Slugify(tag))
Expand All @@ -44,12 +29,6 @@ func BadHashtagsPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error
}
}

if len(potentiallyBadHashtagCombo) > 0 && len(potentiallyBadHashtags) > 0 {
c.AddRecordFlag("bad-hashtag-combo")
c.ReportRecord(automod.ReportReasonRude, fmt.Sprintf("bad hashtag combo: %s %s. account will be taken down", potentiallyBadHashtagCombo, potentiallyBadHashtags))
c.TakedownAccount()
}

return nil
}

Expand Down

0 comments on commit 40079e3

Please sign in to comment.