From fef2d2fdb6f471105aab287a38dd630f6d973568 Mon Sep 17 00:00:00 2001 From: B4D_US3R Date: Wed, 23 Apr 2025 09:09:01 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=B2=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D0=B5/=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20NSFW?= =?UTF-8?q?=20=D1=88=D1=82=D1=83=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- config/config.go | 7 ++++--- service/kiki.go | 2 +- tooter/tooter.go | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) 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