diff --git a/.gitignore b/.gitignore index 83d7ac2..867ccf5 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,7 @@ config.yaml # Output of the go coverage tool, specifically when used with LiteIDE *.out - +kiki # Dependency directories (remove the comment below to include it) # vendor/ diff --git a/config/config.go b/config/config.go index d72955c..b84cd21 100644 --- a/config/config.go +++ b/config/config.go @@ -9,9 +9,10 @@ import ( ) type KikiSettings struct { - Instance string `yaml:"instance,omitempty"` - RSSUri string `yaml:"rss_url,omitempty"` - Redis struct { + Instance string `yaml:"instance,omitempty"` + RSSUri string `yaml:"rss_url,omitempty"` + Sensitive bool `yaml:"sensitive,omitempty"` + Redis struct { Address string `yaml:"address"` } `yaml:"redis"` } diff --git a/service/kiki.go b/service/kiki.go index 8698431..420c0dd 100644 --- a/service/kiki.go +++ b/service/kiki.go @@ -73,7 +73,7 @@ func main() { if !inStack { log.Println(post.Description) - toot, err := tooter.CreateToot(*mastoClient, post) + toot, err := tooter.CreateToot(*mastoClient, post, kikiConfig.Sensitive) if err != nil { log.Println(err) } diff --git a/tooter/tooter.go b/tooter/tooter.go index 7dd91a8..871c0cc 100644 --- a/tooter/tooter.go +++ b/tooter/tooter.go @@ -128,7 +128,7 @@ func UploadPictures(mastoClient mastodon.Client, filesBytes [][]byte) []*mastodo return attachments } -func CreateToot(mastoClient mastodon.Client, newsDesc *gofeed.Item) (mastodon.Toot, error) { +func CreateToot(mastoClient mastodon.Client, newsDesc *gofeed.Item, sensitive bool) (mastodon.Toot, error) { var imgArray []string var attachments []*mastodon.Attachment