aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-search.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-22 15:34:59 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-22 15:34:59 +0100
commit19051d7ada81e5abc56b42de838ab7b26c31bd9b (patch)
treeba77a029c345d618e63bb9da5f6990fc32286914 /lisp/mastodon-search.el
parentee65d8afcbd113c7a1104cf84b214fb87722b474 (diff)
remove redundant --get-search(-json) funs, use new params --get-json
Diffstat (limited to 'lisp/mastodon-search.el')
-rw-r--r--lisp/mastodon-search.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el
index fee79c4..f83cccb 100644
--- a/lisp/mastodon-search.el
+++ b/lisp/mastodon-search.el
@@ -61,8 +61,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")))
- (mastodon-http--get-search-json url query))))
+ (mastodon-http--get-json url `(("q" . ,query) ("following" . "true")))
+ (mastodon-http--get-json url `(("q" . ,query))))))
(mapcar #'mastodon-search--get-user-info-@ response)))
;; functions for tags completion:
@@ -72,8 +72,10 @@ 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 '(("type" . "hashtags")))
- (response (mastodon-http--get-search-json url query type-param))
+ ;; (type-param '(("type" . "hashtags")))
+ (params `(("q" . ,query)
+ ("type" . "hashtags")))
+ (response (mastodon-http--get-json url params))
(tags (alist-get 'hashtags response)))
(mapcar #'mastodon-search--get-hashtag-info tags)))
@@ -112,7 +114,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))