From 189ebfcd6b5939c916cd3673dbbb26963e257a58 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sat, 11 Jan 2020 22:17:06 +0000 Subject: [PATCH] cmd/mi: ignore bot posts --- cmd/mi/mastodon.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/cmd/mi/mastodon.go b/cmd/mi/mastodon.go index e1873f0..895883d 100644 --- a/cmd/mi/mastodon.go +++ b/cmd/mi/mastodon.go @@ -83,9 +83,10 @@ type MastodonStatus struct { Account struct { Acct string `json:"acct"` } `json:"account"` - URL string `json:"url"` - Content string `json:"content"` - Sensitive bool `json:"sensitive"` + URL string `json:"url"` + Content string `json:"content"` + Sensitive bool `json:"sensitive"` + Application *madon.Application `json:"application"` } type NewStatus struct { @@ -127,8 +128,17 @@ func (mi *Mi) StreamMastodonToTwitter(ctx context.Context) { if err != nil { ln.FatalErr(ctx, err) } + + if ns.NewVal == nil { + continue + } + st := ns.NewVal + if st.Application.Name == "mi_irl" { + continue + } + if st.Sensitive { continue }