From 2bf81965326040e99b2cc2ba9f1850d1c9868160 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 13 Sep 2022 13:00:41 +0200 Subject: another proper-list-p test --- lisp/mastodon-tl.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lisp/mastodon-tl.el') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 4726d29..158ba5f 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -668,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) -- cgit v1.2.3 From 0b7c807612e64fbdb539c39399a1301f3de374ce Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 29 Oct 2022 12:20:04 +0200 Subject: t = yes, :json-false = no, in instance description display --- lisp/mastodon-tl.el | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'lisp/mastodon-tl.el') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 158ba5f..ce5d745 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1498,17 +1498,24 @@ IND is the optional indentation level to print at." (mastodon-tl--print-json-keys (cdr el) (if ind (+ ind 4) 4))) (t - (when ind (indent-to ind)) - (insert (mastodon-tl--format-key el pad) - " " - (mastodon-tl--newline-if-long el) - ;; only send strings straight to --render-text - ;; this makes hyperlinks work: - (if (not (stringp (cdr el))) - (mastodon-tl--render-text - (prin1-to-string (cdr el))) - (mastodon-tl--render-text (cdr el))) - "\n"))))))) + ;; basic handling of raw booleans: + (let ((val (cond ((equal (cdr el) ':json-false) + "no") + ((equal (cdr el) 't) + "yes") + (t + (cdr el))))) + (when ind (indent-to ind)) + (insert (mastodon-tl--format-key el pad) + " " + (mastodon-tl--newline-if-long el) + ;; only send strings straight to --render-text + ;; this makes hyperlinks work: + (if (not (stringp val)) + (mastodon-tl--render-text + (prin1-to-string val)) + (mastodon-tl--render-text val)) + "\n")))))))) (defun mastodon-tl--print-instance-rules-or-fields (alist) "Print ALIST of instance rules or contact account fields." -- cgit v1.2.3 From 7b5b03b43f1287462775807f3bc4015473ad38c0 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 29 Oct 2022 12:20:25 +0200 Subject: get instance from account/url, so it works for ppl on own instance --- lisp/mastodon-tl.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lisp/mastodon-tl.el') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index ce5d745..130b01f 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1414,13 +1414,12 @@ INSTANCE is an instance domain name." (reblog (alist-get 'reblog toot)) (account (or (alist-get 'account reblog) (alist-get 'account toot))) - (acct (alist-get 'acct account)) + (url (alist-get 'url account)) (username (alist-get 'username account)) - (instance - (concat "https://" - (or instance - (string-remove-prefix (concat username "@") - acct)))) + (instance (if instance + (concat "https://" instance) + (string-remove-suffix (concat "/@" username) + url))) (response (mastodon-http--get-json (if user (mastodon-http--api "instance") -- cgit v1.2.3