diff --git a/README.md b/README.md index fbd52e8..447c4e9 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,11 @@ If you get a [permission failure](https://github.com/anmonteiro/lumo/issues/206) "r/Clojure" "https://www.reddit.com/r/clojure/.rss"} :mastodon {:access_token "XXXX" :api_url "https://botsin.space/api/v1/" + ;; optional boolean to makr content as sensitive + :sensitive true + ;; optional visibility flag: direct, private, unlisted, public + ;; defaults to public + :visibility "unlisted" ;; optional limit for the post length :max-post-length 300 ;; optional flag specifying wether the name of the account diff --git a/mastodon-bot.cljs b/mastodon-bot.cljs index dfc4d4f..730de14 100755 --- a/mastodon-bot.cljs +++ b/mastodon-bot.cljs @@ -63,11 +63,12 @@ ([status-text] (post-status status-text nil)) ([status-text media-ids] - (.post mastodon-client "statuses" - (clj->js (merge {:status (if-let [signature (-> config :mastodon :signature)] - (str status-text "\n" signature) - status-text)} - (when media-ids {:media_ids media-ids})))))) + (let [{:keys [sensitive signature visibility]} (:mastodon config)] + (.post mastodon-client "statuses" + (clj->js (merge {:status (if signature (str status-text "\n" signature) status-text)} + (when media-ids {:media_ids media-ids}) + (when sensitive {:sensitive sensitive}) + (when visibility {:visibility visibility}))))))) (defn post-image [image-stream description callback] (-> (.post mastodon-client "media" #js {:file image-stream :description description})