aboutsummaryrefslogtreecommitdiff
path: root/lisp
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
parent10968bd76b9cb00a80ed6a4d84db0d5f04873cc8 (diff)
parent63814ce94f6d3f2fe3ace8aaf34b1a21a2183e99 (diff)
Merge branch 'develop'
Diffstat (limited to 'lisp')
-rw-r--r--lisp/.dir-locals.el5
-rw-r--r--lisp/mastodon-views.el23
2 files changed, 19 insertions, 9 deletions
diff --git a/lisp/.dir-locals.el b/lisp/.dir-locals.el
new file mode 100644
index 0000000..44e84e5
--- /dev/null
+++ b/lisp/.dir-locals.el
@@ -0,0 +1,5 @@
+;;; Directory Local Variables
+;;; For more information see (info "(emacs) Directory Variables")
+
+;; setting this makes package-lint look in the main file for deps:
+((emacs-lisp-mode . ((package-lint-main-file . "mastodon.el"))))
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")