From ffbe26f4f082c0ed404d8b6b40267bf2e71e2753 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 24 Mar 2023 10:40:40 +0100 Subject: add .dir-locals.el --- lisp/.dir-locals.el | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 lisp/.dir-locals.el (limited to 'lisp') 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")))) -- cgit v1.2.3 From 63814ce94f6d3f2fe3ace8aaf34b1a21a2183e99 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 24 Mar 2023 11:06:11 +0100 Subject: instance-desc: friendica compatibility --- lisp/mastodon-views.el | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'lisp') 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") -- cgit v1.2.3