From d5883843fc82e1ba357d8561ce18434f1775307b Mon Sep 17 00:00:00 2001
From: marty hiatt <martianhiatus [a t] riseup [d o t] net>
Date: Mon, 14 Nov 2022 12:36:11 +0100
Subject: view-instance-description -- pleroma compat

---
 lisp/mastodon-tl.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index ebf3570..a312c0c 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1508,8 +1508,13 @@ INSTANCE is an instance domain name."
           (username (alist-get 'username account))
           (instance (if instance
                         (concat "https://" instance)
-                      (string-remove-suffix (concat "/@" username)
-                                            url)))
+                      ;; 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))))
           (response (mastodon-http--get-json
                      (if user
                          (mastodon-http--api "instance")
-- 
cgit v1.2.3