mv sensitive? to transform

master
jem 4 years ago
parent 0c72647d5b
commit 6ec1930a71

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

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

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