aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2022-01-15 15:06:28 +0100
committermousebot <mousebot@riseup.net>2022-01-15 15:06:28 +0100
commitc8a1f4e982c31de97ab2c333513ca9f84ed16991 (patch)
tree9862843904f8845e9cfabb5749c537b71032e608 /lisp/mastodon-tl.el
parentb4a48b1e2d0a223024bac6940717866334176a9a (diff)
parenta6e43f8b4956e970b72f52e3a137e9a5cd43f2ed (diff)
Merge branch 'develop' into mpv-play-at-point
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 50f5c9e..f984c34 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -495,13 +495,8 @@ START and END are the boundaries of the link in the toot."
mastodon-instance-url))
(maybe-hashtag (mastodon-tl--extract-hashtag-from-url
url toot-instance-url))
- (url-instance (concat "https://"
- (url-host (url-generic-parse-url url))))
- (maybe-userhandle (if (string= mastodon-instance-url url-instance)
- ; if handle is local, then no instance suffix:
- (buffer-substring-no-properties start end)
- (mastodon-tl--extract-userhandle-from-url
- url (buffer-substring-no-properties start end)))))
+ (maybe-userhandle (mastodon-tl--extract-userhandle-from-url
+ url (buffer-substring-no-properties start end))))
(cond (;; Hashtags:
maybe-hashtag
(setq mastodon-tab-stop-type 'hashtag
@@ -553,11 +548,16 @@ START and END are the boundaries of the link in the toot."
BUFFER-TEXT is the text covered by the link with URL, for a user profile
this should be of the form <at-sign><user id>, e.g. \"@Gargon\"."
- (let ((parsed-url (url-generic-parse-url url)))
+ (let* ((parsed-url (url-generic-parse-url url))
+ (local-p (string=
+ (url-host (url-generic-parse-url mastodon-instance-url))
+ (url-host parsed-url))))
(when (and (string= "@" (substring buffer-text 0 1))
(string= (downcase buffer-text)
(downcase (substring (url-filename parsed-url) 1))))
- (concat buffer-text "@" (url-host parsed-url)))))
+ (if local-p
+ buffer-text ; no instance suffic for local mention
+ (concat buffer-text "@" (url-host parsed-url))))))
(defun mastodon-tl--extract-hashtag-from-url (url instance-url)
"Return the hashtag that URL points to or nil if URL is not a tag link.