aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2021-08-07 15:19:30 +0200
committermousebot <mousebot@riseup.net>2021-08-07 15:23:46 +0200
commitd0d7c05519ea8f51df736d74e541517769bbffe0 (patch)
tree0d7761eaaef325f604518ccf697bfeab7c82abd0
parent2bff9c7dfbdb71fab520e876df7f2a8fc864a30e (diff)
fix mentions broken when on local instance
-rw-r--r--lisp/mastodon-tl.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 77caf13..3cde7c3 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -432,15 +432,18 @@ links in the text. If TOOT is nil no parsing occurs."
mastodon-instance-url))
(maybe-hashtag (mastodon-tl--extract-hashtag-from-url
url toot-instance-url))
- (maybe-userhandle (mastodon-tl--extract-userhandle-from-url
- url (buffer-substring-no-properties start end))))
+ (url-instance (concat "https://"
+ (url-host (url-generic-parse-url url))))
+ (maybe-userhandle (if (string= mastodon-instance-url url-instance)
+ (buffer-substring-no-properties start end)
+ (mastodon-tl--extract-userhandle-from-url
+ url (buffer-substring-no-properties start end)))))
(cond (;; Hashtags:
maybe-hashtag
(setq mastodon-tab-stop-type 'hashtag
keymap mastodon-tl--link-keymap
help-echo (concat "Browse tag #" maybe-hashtag)
extra-properties (list 'mastodon-tag maybe-hashtag)))
-
(;; User handles:
maybe-userhandle
(let ((maybe-userid (mastodon-tl--extract-userid-toot
@@ -566,6 +569,7 @@ LINK-TYPE is the type of link to produce."
(mastodon-tl--toggle-spoiler-text position))
((eq link-type 'hashtag)
(mastodon-tl--show-tag-timeline (get-text-property position 'mastodon-tag)))
+ ;; FIXME: user-handle / account / account-id is broken/empty
((eq link-type 'user-handle)
(let ((account-json (get-text-property position 'account))
(account-id (get-text-property position 'account-id)))