aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-search.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-24 15:40:51 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-24 15:40:51 +0100
commitad2379ad7d0de022b92e07cabeaa4f08b7cdbf55 (patch)
tree072c4ffd7c792e445cfee1efd171f5c316b5a7b0 /lisp/mastodon-search.el
parent1713abbe28c4a8ad684b651450b2c6e06a512c9a (diff)
parentb2b8fe39b6863a1398bf7d50e9ee9bc3143d2fe2 (diff)
Merge branch 'develop' into capf-completion
Diffstat (limited to 'lisp/mastodon-search.el')
-rw-r--r--lisp/mastodon-search.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el
index 8530b5c..7ff8b07 100644
--- a/lisp/mastodon-search.el
+++ b/lisp/mastodon-search.el
@@ -67,8 +67,8 @@ Returns a nested list containing user handle, display name, and URL."
(interactive "sSearch mastodon for: ")
(let* ((url (mastodon-http--api "accounts/search"))
(response (if (equal mastodon-toot--completion-style-for-mentions "following")
- (mastodon-http--get-search-json url query "following=true" :silent)
- (mastodon-http--get-search-json url query nil :silent))))
+ (mastodon-http--get-json url `(("q" . ,query) ("following" . "true")) :silent)
+ (mastodon-http--get-json url `(("q" . ,query)) :silent))))
(if capf
(mapcar #'mastodon-search--get-user-info-@-capf response)
(mapcar #'mastodon-search--get-user-info-@ response))))
@@ -80,8 +80,9 @@ Returns a nested list containing user handle, display name, and URL."
QUERY is the string to search."
(interactive "sSearch for hashtag: ")
(let* ((url (format "%s/api/v2/search" mastodon-instance-url))
- (type-param (concat "type=hashtags"))
- (response (mastodon-http--get-search-json url query type-param :silent))
+ (params `(("q" . ,query)
+ ("type" . "hashtags")))
+ (response (mastodon-http--get-json url params :silent))
(tags (alist-get 'hashtags response)))
(mapcar #'mastodon-search--get-hashtag-info tags)))
@@ -120,7 +121,7 @@ QUERY is the string to search."
(interactive "sSearch mastodon for: ")
(let* ((url (format "%s/api/v2/search" mastodon-instance-url))
(buffer (format "*mastodon-search-%s*" query))
- (response (mastodon-http--get-search-json url query))
+ (response (mastodon-http--get-json url `(("q" . ,query))))
(accts (alist-get 'accounts response))
(tags (alist-get 'hashtags response))
(statuses (alist-get 'statuses response))