Добавил включение/отключение NSFW штук
This commit is contained in:
parent
1f1c964e91
commit
fef2d2fdb6
4 changed files with 7 additions and 6 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -18,7 +18,7 @@ config.yaml
|
||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||||
*.out
|
*.out
|
||||||
|
kiki
|
||||||
# Dependency directories (remove the comment below to include it)
|
# Dependency directories (remove the comment below to include it)
|
||||||
# vendor/
|
# vendor/
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import (
|
||||||
type KikiSettings struct {
|
type KikiSettings struct {
|
||||||
Instance string `yaml:"instance,omitempty"`
|
Instance string `yaml:"instance,omitempty"`
|
||||||
RSSUri string `yaml:"rss_url,omitempty"`
|
RSSUri string `yaml:"rss_url,omitempty"`
|
||||||
|
Sensitive bool `yaml:"sensitive,omitempty"`
|
||||||
Redis struct {
|
Redis struct {
|
||||||
Address string `yaml:"address"`
|
Address string `yaml:"address"`
|
||||||
} `yaml:"redis"`
|
} `yaml:"redis"`
|
||||||
|
|
|
@ -73,7 +73,7 @@ func main() {
|
||||||
if !inStack {
|
if !inStack {
|
||||||
log.Println(post.Description)
|
log.Println(post.Description)
|
||||||
|
|
||||||
toot, err := tooter.CreateToot(*mastoClient, post)
|
toot, err := tooter.CreateToot(*mastoClient, post, kikiConfig.Sensitive)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,7 +128,7 @@ func UploadPictures(mastoClient mastodon.Client, filesBytes [][]byte) []*mastodo
|
||||||
return attachments
|
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 imgArray []string
|
||||||
var attachments []*mastodon.Attachment
|
var attachments []*mastodon.Attachment
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue