aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-views.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-03-24 11:11:15 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-03-24 11:11:15 +0100
commitd4b4fd0e8e5b594890c594484f407d7e49cff533 (patch)
treeb660edf92cd7bebe16e85fbcb835c41bd22ebdee /lisp/mastodon-views.el
parent10968bd76b9cb00a80ed6a4d84db0d5f04873cc8 (diff)
parent63814ce94f6d3f2fe3ace8aaf34b1a21a2183e99 (diff)
Merge branch 'develop'
Diffstat (limited to 'lisp/mastodon-views.el')
-rw-r--r--lisp/mastodon-views.el23
1 files changed, 14 insertions, 9 deletions
diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el
index 9c016c3..affd899 100644
--- a/lisp/mastodon-views.el
+++ b/lisp/mastodon-views.el
@@ -754,15 +754,20 @@ INSTANCE is an instance domain name."
(username (if (mastodon-tl--property 'profile-json)
(alist-get 'username toot) ;; profile
(alist-get 'username account)))
- (instance (if instance
- (concat "https://" instance)
- ;; pleroma URL is https://instance.com/users/username
- (if (string-suffix-p "users/" (url-basepath url))
- (string-remove-suffix "/users/"
- (url-basepath url))
- ;; mastodon:
- (string-remove-suffix (concat "/@" username)
- url))))
+ (instance (cond (instance
+ (concat "https://" instance))
+ ;; pleroma URL is https://instance.com/users/username
+ ((string-suffix-p "users/" (url-basepath url))
+ (string-remove-suffix "/users/"
+ (url-basepath url)))
+ ;; friendica is https://instance.com/profile/user
+ ((string-suffix-p "profile/" (url-basepath url))
+ (string-remove-suffix "/profile/"
+ (url-basepath url)))
+ ;; mastodon:
+ (t
+ (string-remove-suffix (concat "/@" username)
+ url))))
(response (mastodon-http--get-json
(if user
(mastodon-http--api "instance")