aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-09-02 16:56:24 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-09-02 16:56:24 +0200
commitd47e55c48417da0e822c82f7104af9a3d426ddfd (patch)
tree670e42889974689617617e723a78ce03f3970c0b /lisp
parentb900ab8e87cb3f30b48444ac2153095f83a8d6b9 (diff)
start on loading masto URL links in mastodon.el
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-tl.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 8e3ab30..816829e 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1174,6 +1174,13 @@ webapp"
(reblog (alist-get 'reblog json)))
(if reblog (alist-get 'id reblog) id)))
+(defun mastodon-tl--single-toot-from-url (url)
+ "Open the toot at URL in `mastodon.el'."
+ ;; TODO: test if URL is masto
+ ;; FIXME: this only works 1/2 the time
+ (let ((id (url-file-nondirectory url)))
+ (mastodon-tl--single-toot id)))
+
(defun mastodon-tl--single-toot (&optional id)
"View toot at point in separate buffer.
ID is that of the toot to view."