From f994ae1b71a8e0b0d4d9c9248e0d55d92e6b3d3e Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 31 Oct 2023 15:57:56 +0100 Subject: add role badge to profiles. FIX #504. --- lisp/mastodon-profile.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index d3b840e..e21c3dd 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -553,6 +553,15 @@ FIELDS means provide a fields vector fetched by other means." (when (not (equal :json-false x)) (setq result x))))) +(defun mastodon-profile--render-roles (roles) + "Return a propertized string of badges for ROLES." + (mapconcat + (lambda (role) + (propertize + (alist-get 'name role) + 'face `(:box t :foreground ,(alist-get 'color role)))) + roles)) + (defun mastodon-profile--make-profile-buffer-for (account endpoint-type update-function &optional no-reblogs headers) "Display profile of ACCOUNT, using ENDPOINT-TYPE and UPDATE-FUNCTION. @@ -603,6 +612,10 @@ HEADERS means also fetch link headers for pagination." (mastodon-profile--image-from-account account 'header_static) "\n" (propertize .display_name 'face 'mastodon-display-name-face) + ;; roles + (when .roles + (concat " " + (mastodon-profile--render-roles .roles))) "\n" (propertize (concat "@" .acct) 'face 'default) (if (equal .locked t) -- cgit v1.2.3 From 8e576fc29715436adbf8bda0432d909e3f15de2e Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 9 Nov 2023 22:34:55 +0100 Subject: implement exclude_replies on profile view, inc. cycle --- lisp/mastodon-profile.el | 63 ++++++++++++++++++++++++++++-------------------- lisp/mastodon-tl.el | 2 ++ 2 files changed, 39 insertions(+), 26 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index e21c3dd..4870dae 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -140,11 +140,12 @@ contains") "Get the next item-json." (mastodon-tl--property 'item-json)) -(defun mastodon-profile--make-author-buffer (account &optional no-reblogs) +(defun mastodon-profile--make-author-buffer + (account &optional no-reblogs no-replies) "Take an ACCOUNT json and insert a user account into a new buffer. NO-REBLOGS means do not display boosts in statuses." (mastodon-profile--make-profile-buffer-for - account "statuses" #'mastodon-tl--timeline no-reblogs)) + account "statuses" #'mastodon-tl--timeline no-reblogs nil no-replies)) ;; TODO: we shd just load all views' data then switch coz this is slow af: (defun mastodon-profile--account-view-cycle () @@ -153,17 +154,28 @@ NO-REBLOGS means do not display boosts in statuses." (cond ((mastodon-tl--buffer-type-eq 'profile-statuses) (mastodon-profile--open-statuses-no-reblogs)) ((mastodon-tl--buffer-type-eq 'profile-statuses-no-boosts) + (mastodon-profile--open-statuses-no-replies)) + ((mastodon-tl--buffer-type-eq 'profile-statuses-no-replies) (mastodon-profile--open-followers)) ((mastodon-tl--buffer-type-eq 'profile-followers) (mastodon-profile--open-following)) ((mastodon-tl--buffer-type-eq 'profile-following) (mastodon-profile--make-author-buffer mastodon-profile--account)))) +(defun mastodon-profile--open-statuses-no-replies () + "Open a profile buffer showing statuses including replies." + (interactive) + (if mastodon-profile--account + (mastodon-profile--make-author-buffer + mastodon-profile--account nil :no-replies) + (user-error "Not in a mastodon profile"))) + (defun mastodon-profile--open-statuses-no-reblogs () "Open a profile buffer showing statuses without reblogs." (interactive) (if mastodon-profile--account - (mastodon-profile--make-author-buffer mastodon-profile--account :no-reblogs) + (mastodon-profile--make-author-buffer + mastodon-profile--account :no-reblogs) (user-error "Not in a mastodon profile"))) (defun mastodon-profile--open-following () @@ -171,11 +183,8 @@ NO-REBLOGS means do not display boosts in statuses." (interactive) (if mastodon-profile--account (mastodon-profile--make-profile-buffer-for - mastodon-profile--account - "following" - #'mastodon-profile--format-user - nil - :headers) + mastodon-profile--account "following" + #'mastodon-profile--format-user nil :headers) (user-error "Not in a mastodon profile"))) (defun mastodon-profile--open-followers () @@ -183,30 +192,23 @@ NO-REBLOGS means do not display boosts in statuses." (interactive) (if mastodon-profile--account (mastodon-profile--make-profile-buffer-for - mastodon-profile--account - "followers" - #'mastodon-profile--format-user - nil - :headers) + mastodon-profile--account "followers" + #'mastodon-profile--format-user nil :headers) (user-error "Not in a mastodon profile"))) (defun mastodon-profile--view-favourites () "Open a new buffer displaying the user's favourites." (interactive) (message "Loading your favourited toots...") - (mastodon-tl--init "favourites" - "favourites" - 'mastodon-tl--timeline - :headers)) + (mastodon-tl--init "favourites" "favourites" + 'mastodon-tl--timeline :headers)) (defun mastodon-profile--view-bookmarks () "Open a new buffer displaying the user's bookmarks." (interactive) (message "Loading your bookmarked toots...") - (mastodon-tl--init "bookmarks" - "bookmarks" - 'mastodon-tl--timeline - :headers)) + (mastodon-tl--init "bookmarks" "bookmarks" + 'mastodon-tl--timeline :headers)) (defun mastodon-profile--add-account-to-list () "Add account of current profile buffer to a list." @@ -563,19 +565,28 @@ FIELDS means provide a fields vector fetched by other means." roles)) (defun mastodon-profile--make-profile-buffer-for - (account endpoint-type update-function &optional no-reblogs headers) + (account endpoint-type update-function + &optional no-reblogs headers no-replies) "Display profile of ACCOUNT, using ENDPOINT-TYPE and UPDATE-FUNCTION. NO-REBLOGS means do not display boosts in statuses. HEADERS means also fetch link headers for pagination." (let-alist account (let* ((args `(("limit" . ,mastodon-tl--timeline-posts-count))) - (args (if no-reblogs (push '("exclude_reblogs" . "t") args) args)) + (args (cond (no-reblogs + (push '("exclude_reblogs" . "t") args)) + (no-replies + (push '("exclude_replies" . "t") args)) + (t + args))) (endpoint (format "accounts/%s/%s" .id endpoint-type)) (url (mastodon-http--api endpoint)) (buffer (concat "*mastodon-" .acct "-" - (if no-reblogs - (concat endpoint-type "-no-boosts") - endpoint-type) + (cond (no-reblogs + (concat endpoint-type "-no-boosts")) + (no-replies + (concat endpoint-type "-no-replies")) + (t + endpoint-type)) "*")) (response (if headers (mastodon-http--get-response url args) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index db185d6..cb478b5 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1578,6 +1578,8 @@ call this function after it is set or use something else." ;; posts inc. boosts: ((string-suffix-p "no-boosts*" buffer-name) 'profile-statuses-no-boosts) + ((string-suffix-p "no-replies*" buffer-name) + 'profile-statuses-no-replies) ((mastodon-tl--endpoint-str-= "statuses" :suffix) 'profile-statuses) ;; profile followers -- cgit v1.2.3 From 8108187270e4dd1638013de5a51641f45e3abc09 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 9 Nov 2023 22:35:20 +0100 Subject: buffer-for: fix () to ensure goto point min works on cycle --- lisp/mastodon-profile.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 4870dae..625da0a 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -682,13 +682,13 @@ HEADERS means also fetch link headers for pagination." (when (and pinned (equal endpoint-type "statuses")) (mastodon-profile--insert-statuses-pinned pinned) (setq mastodon-tl--update-point (point))) ; updates after pinned toots - (funcall update-function json))) - (goto-char (point-min)) - (message - (substitute-command-keys - ;; "\\[mastodon-profile--account-view-cycle]" ; not always bound? - "\\`C-c C-c' to cycle profile views: toots, followers, following. -\\`C-c C-s' to search user's toots."))))) + (funcall update-function json)) + (goto-char (point-min)) + (message + (substitute-command-keys + ;; "\\[mastodon-profile--account-view-cycle]" ; not always bound? + "\\`C-c C-c' to cycle profile views: toots, followers, following. +\\`C-c C-s' to search user's toots.")))))) (defun mastodon-profile--format-joined-date-string (joined) "Format a human-readable Joined string from timestamp JOINED. -- cgit v1.2.3 From a6680b093e2b144457f01e994ad71b91535f325e Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 10 Nov 2023 16:35:49 +0100 Subject: remove ;; Version: strings in buffers other than mastodon.el --- lisp/mastodon-async.el | 1 - lisp/mastodon-auth.el | 1 - lisp/mastodon-client.el | 1 - lisp/mastodon-discover.el | 1 - lisp/mastodon-http.el | 1 - lisp/mastodon-inspect.el | 1 - lisp/mastodon-iso.el | 1 - lisp/mastodon-media.el | 1 - lisp/mastodon-notifications.el | 1 - lisp/mastodon-profile.el | 1 - lisp/mastodon-search.el | 1 - lisp/mastodon-tl.el | 1 - lisp/mastodon-toot.el | 1 - lisp/mastodon-views.el | 1 - 14 files changed, 14 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-async.el b/lisp/mastodon-async.el index 9de69db..0c70560 100644 --- a/lisp/mastodon-async.el +++ b/lisp/mastodon-async.el @@ -3,7 +3,6 @@ ;; Copyright (C) 2017 Alex J. Griffith ;; Author: Alex J. Griffith ;; Maintainer: Marty Hiatt -;; Version: 1.0.0 ;; Package-Requires: ((emacs "27.1")) ;; Homepage: https://codeberg.org/martianh/mastodon.el diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index 5867b97..1a3e539 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -4,7 +4,6 @@ ;; Copyright (C) 2021 Abhiseck Paira ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 1.0.0 ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-client.el b/lisp/mastodon-client.el index 9b4fee9..493f9df 100644 --- a/lisp/mastodon-client.el +++ b/lisp/mastodon-client.el @@ -4,7 +4,6 @@ ;; Copyright (C) 2021 Abhiseck Paira ;; Author: Johnson Denen ;; Maintainer: Marty Hiatt -;; Version: 1.0.0 ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-discover.el b/lisp/mastodon-discover.el index da25196..5548b29 100644 --- a/lisp/mastodon-discover.el +++ b/lisp/mastodon-discover.el @@ -5,7 +5,6 @@ ;; Author: Johnson Denen ;; Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 1.0.0 ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 8764764..a357672 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -5,7 +5,6 @@ ;; Author: Johnson Denen ;; Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 1.0.0 ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-inspect.el b/lisp/mastodon-inspect.el index 0a278ab..43c8ba4 100644 --- a/lisp/mastodon-inspect.el +++ b/lisp/mastodon-inspect.el @@ -5,7 +5,6 @@ ;; Author: Johnson Denen ;; Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 1.0.0 ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-iso.el b/lisp/mastodon-iso.el index 909d3dd..8ea5635 100644 --- a/lisp/mastodon-iso.el +++ b/lisp/mastodon-iso.el @@ -2,7 +2,6 @@ ;; Copyright (C) 2022 Marty Hiatt ;; Author: Marty Hiatt -;; Version: 1.0.0 ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index 04cf0c2..561327c 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -5,7 +5,6 @@ ;; Author: Johnson Denen ;; Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 1.0.0 ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el index a1aea31..2c61cd4 100644 --- a/lisp/mastodon-notifications.el +++ b/lisp/mastodon-notifications.el @@ -5,7 +5,6 @@ ;; Author: Johnson Denen ;; Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 1.0.0 ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 625da0a..4fb73d6 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -5,7 +5,6 @@ ;; Author: Johnson Denen ;; Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 1.0.0 ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 1f39088..ac32efb 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -3,7 +3,6 @@ ;; Copyright (C) 2017-2019 Marty Hiatt ;; Author: Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 1.0.0 ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index cb478b5..8e3ce4a 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -5,7 +5,6 @@ ;; Author: Johnson Denen ;; Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 1.0.0 ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index aee83ad..2951ac8 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -5,7 +5,6 @@ ;; Author: Johnson Denen ;; Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 1.0.0 ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el index b1ff70d..28f7c7c 100644 --- a/lisp/mastodon-views.el +++ b/lisp/mastodon-views.el @@ -3,7 +3,6 @@ ;; Copyright (C) 2020-2022 Marty Hiatt ;; Author: Marty Hiatt ;; Maintainer: Marty Hiatt -;; Version: 1.0.0 ;; Homepage: https://codeberg.org/martianh/mastodon.el ;; This file is not part of GNU Emacs. -- cgit v1.2.3 From 693244adecddbacc9d4a21a34902996d44657c8d Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 11 Nov 2023 12:10:29 +0100 Subject: add (no replies) to statuses no replies profile view --- lisp/mastodon-profile.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 4fb73d6..1c41f24 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -609,9 +609,12 @@ HEADERS means also fetch link headers for pagination." (is-followers (string= endpoint-type "followers")) (is-following (string= endpoint-type "following")) (endpoint-name (cond - (is-statuses (if no-reblogs - " TOOTS (no boosts)" - " TOOTS ")) + (is-statuses (cond (no-reblogs + " TOOTS (no boosts)") + (no-replies + " TOOTS (no replies)") + (t + " TOOTS "))) (is-followers " FOLLOWERS ") (is-following " FOLLOWING ")))) (insert -- cgit v1.2.3 From 65821b2f24c40fbd5cb703757913af54b7e47243 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Tue, 14 Nov 2023 21:20:45 +0100 Subject: update help-echo for new profile cycle cmds --- lisp/mastodon-profile.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 1c41f24..0d93747 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -689,7 +689,8 @@ HEADERS means also fetch link headers for pagination." (message (substitute-command-keys ;; "\\[mastodon-profile--account-view-cycle]" ; not always bound? - "\\`C-c C-c' to cycle profile views: toots, followers, following. + "\\`C-c C-c' to cycle profile views: toots, no replies, no boosts,\ + followers, following. \\`C-c C-s' to search user's toots.")))))) (defun mastodon-profile--format-joined-date-string (joined) -- cgit v1.2.3 From 20b41bfa9512cc643c23b8e3d8062c8bebf0be79 Mon Sep 17 00:00:00 2001 From: Björn Bidar Date: Thu, 5 Oct 2023 21:24:08 +0300 Subject: Avoid error when there's only one window in a frame when closing window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use `(quit-window 'kill)` instead of `(kill-buffer-and-window)` to avoid error when there's only one window instead the frame: `kill-buffer-and-window: Attempt to delete minibuffer or sole ordinary window` Signed-off-by: Björn Bidar --- lisp/mastodon-discover.el | 4 +++- lisp/mastodon-profile.el | 7 ++++--- lisp/mastodon-toot.el | 3 ++- lisp/mastodon.el | 8 +++++++- 4 files changed, 16 insertions(+), 6 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-discover.el b/lisp/mastodon-discover.el index 5548b29..715954f 100644 --- a/lisp/mastodon-discover.el +++ b/lisp/mastodon-discover.el @@ -35,6 +35,8 @@ (declare-function discover-add-context-menu "discover") +(autoload 'mastodon-kill-window "mastodon") + (defun mastodon-discover () "Plug Mastodon functionality into `discover'." (interactive) @@ -115,7 +117,7 @@ ("C-c C-c" "Cycle profile views" mastodon-profile--account-view-cycle)) ("Quit" ("q" "Quit mastodon and bury buffer." kill-this-buffer) - ("Q" "Quit mastodon buffer and kill window." kill-buffer-and-window) + ("Q" "Quit mastodon buffer and kill window." mastodon--kill-window) ("M-C-q" "Quit mastodon and kill all buffers." mastodon-kill-all-buffers))))))) (provide 'mastodon-discover) diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 0d93747..22dd586 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -50,6 +50,7 @@ (autoload 'mastodon-http--patch-json "mastodon-http") (autoload 'mastodon-http--post "mastodon-http.el") (autoload 'mastodon-http--triage "mastodon-http.el") +(autoload 'mastodon-kill-window "mastodon") (autoload 'mastodon-media--get-media-link-rendering "mastodon-media.el") (autoload 'mastodon-media--inline-images "mastodon-media.el") (autoload 'mastodon-mode "mastodon.el") @@ -294,7 +295,7 @@ NO-REBLOGS means do not display boosts in statuses." "Cancel updating user profile and kill buffer and window." (interactive) (when (y-or-n-p "Cancel updating your profile note?") - (kill-buffer-and-window))) + (mastodon-kill-window))) (defun mastodon-profile--note-remove-header () "Get the body of a toot from the current compose buffer." @@ -310,9 +311,9 @@ Ask for confirmation if length > 500 characters." (url (mastodon-http--api "accounts/update_credentials"))) (if (> (mastodon-toot--count-toot-chars note) 500) (when (y-or-n-p "Note is over mastodon's max for profile notes (500). Proceed?") - (kill-buffer-and-window) + (quit-window 'kill) (mastodon-profile--user-profile-send-updated-do url note)) - (kill-buffer-and-window) + (quit-window 'kill) (mastodon-profile--user-profile-send-updated-do url note)))) (defun mastodon-profile--user-profile-send-updated-do (url note) diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index c96ee5b..c26db1e 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -64,6 +64,7 @@ (autoload 'mastodon-http--put "mastodon-http") (autoload 'mastodon-http--read-file-as-string "mastodon-http") (autoload 'mastodon-http--triage "mastodon-http") +(autoload 'mastodon-kill-window "mastodon") (autoload 'mastodon-profile--fetch-server-account-settings "mastodon-profile") (autoload 'mastodon-profile--fetch-server-account-settings-maybe "mastodon-profile") (autoload 'mastodon-profile--get-source-pref "mastodon-profile") @@ -682,7 +683,7 @@ CANCEL means the toot was not sent, so we save the toot text as a draft." mastodon-toot-draft-toots-list :test 'equal))) ;; prevent some weird bug when cancelling a non-empty toot: (delete #'mastodon-toot--save-toot-text after-change-functions) - (kill-buffer-and-window) + (quit-window 'kill) (mastodon-toot--restore-previous-window-config prev-window-config))) (defun mastodon-toot--cancel () diff --git a/lisp/mastodon.el b/lisp/mastodon.el index acd1462..bac4d67 100644 --- a/lisp/mastodon.el +++ b/lisp/mastodon.el @@ -142,6 +142,12 @@ The default value \"%F %T\" prints ISO8601-style YYYY-mm-dd HH:MM:SS. Use. e.g. \"%c\" for your locale's date and time format." :type 'string) + +(defun mastodon-kill-window () + "Quit window and delete helper." + (interactive) + (quit-window 'kill)) + (defvar mastodon-mode-map (let ((map (make-sparse-keymap))) ;; navigation inside a timeline @@ -169,7 +175,7 @@ Use. e.g. \"%c\" for your locale's date and time format." (define-key map (kbd "/") #'mastodon-switch-to-buffer) ;; quitting mastodon (define-key map (kbd "q") #'kill-current-buffer) - (define-key map (kbd "Q") #'kill-buffer-and-window) + (define-key map (kbd "Q") #'mastodon-kill-window) (define-key map (kbd "M-C-q") #'mastodon-kill-all-buffers) ;; toot actions (define-key map (kbd "c") #'mastodon-tl--toggle-spoiler-text-in-toot) -- cgit v1.2.3 From 3b3f5228ac9637cb40d15b829912887f72a0590e Mon Sep 17 00:00:00 2001 From: David Edmondson Date: Mon, 15 Jan 2024 13:34:33 +0000 Subject: profile: Use v2 search when looking for users --- lisp/mastodon-profile.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lisp/mastodon-profile.el') diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 22dd586..fc90cf7 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -777,13 +777,13 @@ If the handle does not match a search return then retun NIL." (let* ((handle (if (string= "@" (substring handle 0 1)) (substring handle 1 (length handle)) handle)) - (args `(("q" . ,handle))) + (args `(("q" . ,handle) + ("type" . "accounts"))) + (result (mastodon-http--get-json (mastodon-http--api-search) args)) (matching-account (seq-remove (lambda (x) (not (string= (alist-get 'acct x) handle))) - (mastodon-http--get-json - (mastodon-http--api "accounts/search") - args)))) + (alist-get 'accounts result)))) (when (equal 1 (length matching-account)) (elt matching-account 0)))) -- cgit v1.2.3