aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-03-24 11:06:11 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-03-24 11:06:11 +0100
commit63814ce94f6d3f2fe3ace8aaf34b1a21a2183e99 (patch)
tree4e22ceb54e84c34bf15361cc4d2d6cc1b2df83eb /lisp
parentffbe26f4f082c0ed404d8b6b40267bf2e71e2753 (diff)
instance-desc: friendica compatibility
Diffstat (limited to 'lisp')
-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")