diff options
author | mousebot <mousebot@riseup.net> | 2021-11-01 10:47:23 +0100 |
---|---|---|
committer | mousebot <mousebot@riseup.net> | 2021-11-01 10:51:47 +0100 |
commit | 04465567450d6fc9cdec1a1ba0ef12557b0ab54b (patch) | |
tree | abe0eb83237327617a4985ea68a816ec6fb33ffc /lisp/mastodon-search.el | |
parent | cb288c6e49d46ef7584b16b1fbc7d5c42cb0e5cf (diff) |
include user's profile URL in company mentions completion.
also rename company mentions completion default value to "following" not
"followers", which is what the actual search is called and what it returns.
Diffstat (limited to 'lisp/mastodon-search.el')
-rw-r--r-- | lisp/mastodon-search.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 687b50c..03301ce 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -46,10 +46,11 @@ ;; functions for company completion of mentions in mastodon-toot -(defun mastodon-search--get-user-info-no-url (account) +(defun mastodon-search--get-user-info (account) "Get user handle, display name and account URL from ACCOUNT." (list (cdr (assoc 'display_name account)) - (concat "@" (cdr (assoc 'acct account))))) + (concat "@" (cdr (assoc 'acct account))) + (cdr (assoc 'url account)))) (defun mastodon-search--search-accounts-query (query) "Prompt for a search QUERY and return accounts synchronously. @@ -57,10 +58,10 @@ Returns a nested list containing user handle, display name, and URL." (interactive "sSearch mastodon for: ") (let* ((url (format "%s/api/v1/accounts/search" mastodon-instance-url)) ;; (buffer (format "*mastodon-search-%s*" query)) - (response (if (equal mastodon-toot--enable-completion-for-mentions "followers") + (response (if (equal mastodon-toot--enable-completion-for-mentions "following") (mastodon-http--get-search-json url query "following=true") (mastodon-http--get-search-json url query)))) - (mapcar #'mastodon-search--get-user-info-no-url + (mapcar #'mastodon-search--get-user-info response))) ;; functions for mastodon search |