Добавил включение/отключение NSFW штук

This commit is contained in:
B4D_US3R 2025-04-23 09:09:01 +05:00
parent 1f1c964e91
commit fef2d2fdb6
4 changed files with 7 additions and 6 deletions

2
.gitignore vendored
View file

@ -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/

View file

@ -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"`
}

View file

@ -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)
}

View file

@ -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