this repo has no description
1
fork

Configure Feed

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

better domain check

+11 -2
+11 -2
handle_post.go
··· 16 16 return fmt.Sprintf("at://%s/%s/%s", evt.Did, evt.Commit.Collection, evt.Commit.RKey) 17 17 } 18 18 19 + func isPolDomain(domain string) bool { 20 + for d := range sets.PolDomains { 21 + if strings.HasSuffix(domain, d) { 22 + return true 23 + } 24 + } 25 + return false 26 + } 27 + 19 28 func (dsmt *DontShowMeThis) handlePost(ctx context.Context, event *models.Event, post *bsky.FeedPost) error { 20 29 if event == nil || event.Commit == nil { 21 30 return nil ··· 35 44 36 45 domain := strings.ToLower(u.Hostname()) 37 46 38 - if sets.PolDomains[domain] { 47 + if isPolDomain(domain) { 39 48 if err := dsmt.emitLabel(ctx, uriFromEvent(event), LabelPolLink); err != nil { 40 49 return err 41 50 } ··· 56 65 57 66 domain := strings.ToLower(u.Hostname()) 58 67 59 - if sets.PolDomains[domain] { 68 + if isPolDomain(domain) { 60 69 if err := dsmt.emitLabel(ctx, uriFromEvent(event), LabelPolLink); err != nil { 61 70 return err 62 71 }