this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

quick tweaks to rules at scale (#486)

- skip short post text for identical replies
- start reporting bad word records for review

The "short post text" instead of skipping just empty also handles a
common case of "handful of emoji".

authored by

bnewbold and committed by
GitHub
23f022e2 c0558132

+11
+4
automod/rules/keyword.go
··· 1 1 package rules 2 2 3 3 import ( 4 + "fmt" 5 + 4 6 appbsky "github.com/bluesky-social/indigo/api/bsky" 5 7 "github.com/bluesky-social/indigo/automod" 6 8 ) ··· 9 11 for _, tok := range ExtractTextTokensPost(post) { 10 12 if evt.InSet("bad-words", tok) { 11 13 evt.AddRecordFlag("bad-word") 14 + evt.ReportRecord(automod.ReportReasonRude, fmt.Sprintf("bad-word: %s", tok)) 12 15 break 13 16 } 14 17 } ··· 19 22 for _, tok := range ExtractTextTokensProfile(profile) { 20 23 if evt.InSet("bad-words", tok) { 21 24 evt.AddRecordFlag("bad-word") 25 + evt.ReportRecord(automod.ReportReasonRude, fmt.Sprintf("bad-word: %s", tok)) 22 26 break 23 27 } 24 28 }
+7
automod/rules/replies.go
··· 1 1 package rules 2 2 3 3 import ( 4 + "unicode/utf8" 5 + 4 6 appbsky "github.com/bluesky-social/indigo/api/bsky" 5 7 "github.com/bluesky-social/indigo/atproto/syntax" 6 8 "github.com/bluesky-social/indigo/automod" ··· 36 38 // There can be legitimate situations that trigger this rule, so in most situations should be a "report" not "label" action. 37 39 func IdenticalReplyPostRule(evt *automod.RecordEvent, post *appbsky.FeedPost) error { 38 40 if post.Reply == nil || IsSelfThread(evt, post) { 41 + return nil 42 + } 43 + 44 + // short reply? ignore it 45 + if utf8.RuneCountInString(post.Text) <= 10 { 39 46 return nil 40 47 } 41 48