this repo has no description
0
fork

Configure Feed

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

automod: example rule to trigger on unicode reverse character in URLs (#504)

authored by

bnewbold and committed by
GitHub
105e578d 61693a73

+19
+1
automod/rules/all.go
··· 20 20 AggressivePromotionRule, 21 21 IdenticalReplyPostRule, 22 22 DistinctMentionsRule, 23 + MisleadingLinkUnicodeReversalPostRule, 23 24 }, 24 25 ProfileRules: []automod.ProfileRuleFunc{ 25 26 GtubeProfileRule,
+18
automod/rules/misleading_unicode_reverse.go
··· 1 + package rules 2 + 3 + import ( 4 + "strings" 5 + 6 + appbsky "github.com/bluesky-social/indigo/api/bsky" 7 + "github.com/bluesky-social/indigo/automod" 8 + ) 9 + 10 + func MisleadingLinkUnicodeReversalPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error { 11 + 12 + if !strings.Contains(post.Text, "\u202E") { 13 + return nil 14 + } 15 + 16 + c.AddRecordFlag("clickjack-unicode-reversed") 17 + return nil 18 + }