diff --git a/README.md b/README.md index 6335c76..8396226 100644 --- a/README.md +++ b/README.md @@ -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 :account-id "XXXX" :api_url "https://botsin.space/api/v1/" - ;; optional boolean to mark content as sensitive - :sensitive? true ;; optional boolean defaults to false ;; only sources containing media will be posted when set to 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 ;; defaults to public :visibility "unlisted" + ;; optional boolean to mark content as sensitive + :sensitive? true ;; optional signature for posts :signature "#newsbot"}}] } diff --git a/src/main/mastodon_bot/mastodon_api.cljs b/src/main/mastodon_bot/mastodon_api.cljs index b27dc41..f1e69d3 100755 --- a/src/main/mastodon_bot/mastodon_api.cljs +++ b/src/main/mastodon_bot/mastodon_api.cljs @@ -35,7 +35,8 @@ ::signature ::visibility ::append-screen-name? - ;::sensitive? ::resolve-urls? + ::sensitive? + ;::resolve-urls? ;::nitter-urls? ::replacements ])) (def mastodon-config? (s/merge mastodon-auth? mastodon-target?)) @@ -111,8 +112,7 @@ ([mastodon-auth target status-text media-ids] (post-status mastodon-auth target status-text media-ids print)) ([mastodon-auth target status-text media-ids callback] - (let [{:keys [sensitive?]} mastodon-auth - {:keys [visibility]} target] + (let [{:keys [visibility sensitive?]} target] (-> (.post (mastodon-client mastodon-auth) "statuses" (clj->js (merge {:status (->> status-text (resolve-urls mastodon-auth) diff --git a/src/test/mastodon_bot/transform_test.cljs b/src/test/mastodon_bot/transform_test.cljs index 66faf2a..a6b5960 100755 --- a/src/test/mastodon_bot/transform_test.cljs +++ b/src/test/mastodon_bot/transform_test.cljs @@ -16,4 +16,5 @@ :target {:type :mastodon-target :append-screen-name? true :visibility "unlisted" + :sensitive? true :signature "my-bot"}}])))