added support for status flags
This commit is contained in:
parent
0c2832ddf0
commit
6c3879a7fa
2 changed files with 11 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -63,11 +63,12 @@
|
|||
([status-text]
|
||||
(post-status status-text nil))
|
||||
([status-text media-ids]
|
||||
(let [{:keys [sensitive signature visibility]} (:mastodon config)]
|
||||
(.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}))))))
|
||||
(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})
|
||||
|
|
Reference in a new issue