aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-14 15:41:08 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-14 15:41:08 +0100
commit7593590d5c7a1ea9824424cc46d0cad4130eb9b2 (patch)
tree0ece7cbf17ee091853a741ccd8af05563e6fe255
parenta7115bf7eb1339ef85f10028ea8c4b6214aedaad (diff)
view instance description: handle calling from empty profiles
-rw-r--r--lisp/mastodon-tl.el13
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index e8b94d7..3e8c08d 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1494,12 +1494,19 @@ BRIEF means to show fewer details.
INSTANCE is an instance domain name."
(interactive)
(mastodon-tl--do-if-toot
- (let* ((toot (mastodon-tl--property 'toot-json))
+ (let* ((profile-p (get-text-property (point) 'profile-json))
+ (toot (if profile-p
+ (mastodon-tl--property 'profile-json) ; profile may have 0 toots
+ (mastodon-tl--property 'toot-json)))
(reblog (alist-get 'reblog toot))
(account (or (alist-get 'account reblog)
(alist-get 'account toot)))
- (url (alist-get 'url account))
- (username (alist-get 'username account))
+ (url (if profile-p
+ (alist-get 'url toot) ; profile
+ (alist-get 'url account)))
+ (username (if profile-p
+ (alist-get 'username toot) ;; profile
+ (alist-get 'username account)))
(instance (if instance
(concat "https://" instance)
;; pleroma URL is https://instance.com/users/username