diff --git a/pkg/internal/services/mastodon/fetch.go b/pkg/internal/services/mastodon/fetch.go index f59955b..a4e1e32 100644 --- a/pkg/internal/services/mastodon/fetch.go +++ b/pkg/internal/services/mastodon/fetch.go @@ -21,10 +21,11 @@ type MastodomAttachment struct { } type MastodonPost struct { - ID string `json:"id"` - Content string `json:"content"` - URL string `json:"url"` - Account struct { + ID string `json:"id"` + Content string `json:"content"` + URL string `json:"url"` + Sensitive bool `json:"sensitive"` + Account struct { Acct string `json:"acct"` Username string `json:"username"` DisplayName string `json:"display_name"` @@ -84,6 +85,10 @@ func FetchTimeline(server string, limit int) ([]MastodonPost, error) { return nil, fmt.Errorf("failed to parse timeline JSON: %v", err) } + posts = lo.Filter(posts, func(item MastodonPost, index int) bool { + return !item.Sensitive + }) + for idx := range posts { posts[idx].Server = strings.Replace(strings.Replace(server, "https://", "", 1), "http://", "", 1) }