aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-05-26 16:10:44 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-05-26 16:10:44 +0200
commit6f9dafd094aa74264059084ae6d6c8b94da1d82d (patch)
treee29008559aaa21bf3b2592b9889e3dab77a9c58e
parent507d26000303cab1531c3cf9713a9580062e0c4e (diff)
remote local: check domain against known instances.
-rw-r--r--lisp/mastodon-tl.el18
1 files changed, 14 insertions, 4 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 0e5e261..b6166b1 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -469,10 +469,20 @@ With a single prefix ARG, hide replies."
(let* ((domain (read-string "Domain for remote local tl: "))
(params `(("limit" . ,mastodon-tl--timeline-posts-count)
("local" . "true")))
- (buf (concat "remote-local-" domain)))
- (mastodon-tl--init buf
- "timelines/public" 'mastodon-tl--timeline nil
- params nil domain)))
+ (buf (concat "remote-local-" domain))
+ (known (member domain
+ (mastodon-http--get-json
+ (mastodon-http--api "instance/peers")))))
+ ;; TODO: refactor this:
+ (if (not known)
+ (when (y-or-n-p
+ "Domain appears unknown to your instance. Proceed?")
+ (mastodon-tl--init buf
+ "timelines/public" 'mastodon-tl--timeline nil
+ params nil domain))
+ (mastodon-tl--init buf
+ "timelines/public" 'mastodon-tl--timeline nil
+ params nil domain))))
(defun mastodon-tl--get-local-timeline (&optional prefix)
"Open local timeline.