aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/mastodon-profile.el9
-rw-r--r--lisp/mastodon-tl.el8
2 files changed, 16 insertions, 1 deletions
diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el
index b404bb6..012e357 100644
--- a/lisp/mastodon-profile.el
+++ b/lisp/mastodon-profile.el
@@ -365,6 +365,15 @@ Current settings are fetched from the server."
(interactive)
(mastodon-profile--edit-string-value 'display_name))
+(defun mastodon-profile--get-preferences-pref (pref)
+ "Fetch PREF from the endpoint \"/preferences\".
+This endpoint only holds a few preferences. For others, see
+`mastodon-profile--update-preference' and its endpoint,
+\"/accounts/update_credentials.\""
+ (alist-get pref
+ (mastodon-http--get-json
+ (mastodon-http--api "preferences"))))
+
(defun mastodon-profile-view-preferences ()
"View user preferences in another window."
(interactive)
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index d8b2baa..8e75705 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -66,6 +66,7 @@
(autoload 'mastodon-search--get-user-info "mastodon-search")
(autoload 'mastodon-http--delete "mastodon-http")
(autoload 'mastodon-profile--view-author-profile "mastodon-profile")
+(autoload 'mastodon-profile--get-preferences-pref "mastodon-profile")
(when (require 'mpv nil :no-error)
(declare-function mpv-start "mpv"))
@@ -856,7 +857,12 @@ message is a link which unhides/hides the main body."
(concat
cw
(propertize (mastodon-tl--content toot)
- 'invisible t
+ 'invisible
+ ;; check server setting to expand all spoilers:
+ (unless (eq t
+ (mastodon-profile--get-preferences-pref
+ 'reading:expand:spoilers))
+ t)
'mastodon-content-warning-body t))))
(defun mastodon-tl--media (toot)