mv sensitive? to transform

This commit is contained in:
jem 2020-05-29 21:19:43 +02:00
parent 0c72647d5b
commit 6ec1930a71
3 changed files with 6 additions and 5 deletions

View file

@ -50,8 +50,6 @@ with later timestamps to avoid duplicate posts. On the first run the timestamp w
;; e.g: https://mastodon.social/web/accounts/294795 ;; e.g: https://mastodon.social/web/accounts/294795
:account-id "XXXX" :account-id "XXXX"
:api_url "https://botsin.space/api/v1/" :api_url "https://botsin.space/api/v1/"
;; optional boolean to mark content as sensitive
:sensitive? true
;; optional boolean defaults to false ;; optional boolean defaults to false
;; only sources containing media will be posted when set to true ;; only sources containing media will be posted when set to true
:media-only? true :media-only? true
@ -82,6 +80,8 @@ with later timestamps to avoid duplicate posts. On the first run the timestamp w
;; optional visibility flag: direct, private, unlisted, public ;; optional visibility flag: direct, private, unlisted, public
;; defaults to public ;; defaults to public
:visibility "unlisted" :visibility "unlisted"
;; optional boolean to mark content as sensitive
:sensitive? true
;; optional signature for posts ;; optional signature for posts
:signature "#newsbot"}}] :signature "#newsbot"}}]
} }

View file

@ -35,7 +35,8 @@
::signature ::signature
::visibility ::visibility
::append-screen-name? ::append-screen-name?
;::sensitive? ::resolve-urls? ::sensitive?
;::resolve-urls?
;::nitter-urls? ::replacements ;::nitter-urls? ::replacements
])) ]))
(def mastodon-config? (s/merge mastodon-auth? mastodon-target?)) (def mastodon-config? (s/merge mastodon-auth? mastodon-target?))
@ -111,8 +112,7 @@
([mastodon-auth target status-text media-ids] ([mastodon-auth target status-text media-ids]
(post-status mastodon-auth target status-text media-ids print)) (post-status mastodon-auth target status-text media-ids print))
([mastodon-auth target status-text media-ids callback] ([mastodon-auth target status-text media-ids callback]
(let [{:keys [sensitive?]} mastodon-auth (let [{:keys [visibility sensitive?]} target]
{:keys [visibility]} target]
(-> (.post (mastodon-client mastodon-auth) "statuses" (-> (.post (mastodon-client mastodon-auth) "statuses"
(clj->js (merge {:status (->> status-text (clj->js (merge {:status (->> status-text
(resolve-urls mastodon-auth) (resolve-urls mastodon-auth)

View file

@ -16,4 +16,5 @@
:target {:type :mastodon-target :target {:type :mastodon-target
:append-screen-name? true :append-screen-name? true
:visibility "unlisted" :visibility "unlisted"
:sensitive? true
:signature "my-bot"}}]))) :signature "my-bot"}}])))