diff options
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r-- | lisp/mastodon-tl.el | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index d8b2baa..158ba5f 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")) @@ -646,7 +647,9 @@ START and END are the boundaries of the link in the toot." keymap (help-echo (get-text-property start 'help-echo)) extra-properties - (toot-url (mastodon-tl--field 'url toot)) + ;; handle calling this on non-toots, e.g. for profiles: + (toot-url (when (proper-list-p toot) + (mastodon-tl--field 'url toot))) (toot-url (when toot-url (url-generic-parse-url toot-url))) (toot-instance-url (if toot-url (concat (url-type toot-url) "://" @@ -665,8 +668,10 @@ START and END are the boundaries of the link in the toot." (;; User handles: maybe-userhandle ;; this fails on mentions in profile notes: - (let ((maybe-userid (mastodon-tl--extract-userid-toot - toot maybe-userhandle))) + (let ((maybe-userid + (when (proper-list-p toot) + (mastodon-tl--extract-userid-toot + toot maybe-userhandle)))) (setq mastodon-tab-stop-type 'user-handle keymap mastodon-tl--link-keymap help-echo (concat "Browse user profile of " maybe-userhandle) @@ -856,7 +861,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) @@ -1694,7 +1704,13 @@ For use after e.g. deleting a toot." (mastodon-notifications--get)) ((equal (mastodon-tl--buffer-name) (concat "*mastodon-" (mastodon-auth--get-account-name) "-statuses*")) - (mastodon-profile--my-profile)))) + (mastodon-profile--my-profile)) + ((save-match-data + (string-match + "statuses/\\(?2:[[:digit:]]+\\)/context" + (mastodon-tl--get-endpoint)) + (mastodon-tl--thread + (match-string 2 (mastodon-tl--get-endpoint))))))) (defun mastodon-tl--more () "Append older toots to timeline, asynchronously." |