[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mastodon ab62022b50 15/47: implement following "accounts"
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mastodon ab62022b50 15/47: implement following "accounts" search. FIX #493. |
Date: |
Fri, 13 Oct 2023 19:00:55 -0400 (EDT) |
branch: elpa/mastodon
commit ab62022b50ba5d005d6da5d4bdec4f83ce673bc7
Author: marty hiatt <martianhiatus [a t] riseup [d o t] net>
Commit: marty hiatt <martianhiatus [a t] riseup [d o t] net>
implement following "accounts" search. FIX #493.
---
lisp/mastodon-search.el | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el
index 40cf15a1e8..436041defb 100644
--- a/lisp/mastodon-search.el
+++ b/lisp/mastodon-search.el
@@ -149,21 +149,28 @@ PRINT-FUN is the function used to print the data from the
response."
&optional type following account-id)
"Prompt for a search QUERY and return accounts, statuses, and hashtags.
TYPE is a member of `mastodon-search-types'.
-FOLLOWING means limit search to accounts followed.
-ACCOUNT-ID means limit search to that account."
+FOLLOWING means limit to accounts followed, for \"accounts\" type only.
+A single prefix arg also sets FOLLOWING to true.
+ACCOUNT-ID means limit search to that account, for \"statuses\" type only."
;; TODO: handle account search, buffer name etc.
;; TODO: handle no results
(interactive "sSearch mastodon for: ")
(let* ((url (format "%s/api/v2/search" mastodon-instance-url))
+ (following (when (or following
+ (equal current-prefix-arg '(4)))
+ "true"))
(type (or type
- (completing-read "Search type: "
- mastodon-search-types
- nil t)))
+ (if (equal current-prefix-arg '(4))
+ "accounts" ; if FOLLOWING, must be "accounts"
+ (completing-read "Search type: "
+ mastodon-search-types
+ nil t))))
(buffer (format "*mastodon-search-%s-%s*" type query))
- (params `(("q" . ,query)
- ,(when type `("type" . ,type))
- ,(when following `("following" . ,following))
- ,(when account-id `("account_id" . ,account-id))))
+ (params (cl-remove nil
+ `(("q" . ,query)
+ ,(when type `("type" . ,type))
+ ,(when following `("following" . ,following))
+ ,(when account-id `("account_id" .
,account-id)))))
(response (mastodon-http--get-json url params))
(accts (when (equal type "accounts")
(alist-get 'accounts response)))
@@ -215,6 +222,11 @@ ACCOUNT-ID means limit search to that account."
((equal type "statuses")
(mastodon-search--search-query query "hashtags")))))
+(defun mastodon-serach--query-accounts-followed (query)
+ "Run an accounts search QUERY, limited to your followers."
+ (interactive "sSearch mastodon for: ")
+ (mastodon-search--search-query query "accounts" :following))
+
(defun mastodon-search--insert-users-propertized (json &optional note)
"Insert users list into the buffer.
JSON is the data from the server. If NOTE is non-nil, include
- [nongnu] elpa/mastodon updated (9a400d33a5 -> 2cb0a5012a), ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon 31908e88a2 14/47: docstring for account search, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon 44a075c5e9 16/47: index update, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon 15c6a842c3 02/47: url-p: optional @ prefix for "users" url, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon c5aefef00b 06/47: rename two search funs, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon 3c52d556fc 07/47: add completing-read for search type + message binding, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon 6691dab7aa 04/47: handle search type buffers in buffer-type, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon 2cd8a9a38f 08/47: profile:message cycle binding, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon 2a5700a46e 13/47: http: build query str only when we have a value, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon 869917a0e7 09/47: rough account statuses search, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon ab62022b50 15/47: implement following "accounts" search. FIX #493.,
ELPA Syncer <=
- [nongnu] elpa/mastodon 3e0badc4af 17/47: also message profile search binding, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon 433a938c50 22/47: hack to avoid repeat of last search status on calling --more*, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon 9bbcc60818 45/47: search headings even if no results, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon 8c9f827d12 21/47: tl--more*: add cond to handle search data if in search buffer, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon 1b888da280 01/47: readme re friendica, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon 16340dbef1 23/47: add user id to user item inserting, for pagination, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon ce30985860 41/47: fix offset pagination for hashtags search, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon f7526642d3 39/47: add fun mastodon-buffer-p, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon 57d0f9f362 43/47: bump, ELPA Syncer, 2023/10/13
- [nongnu] elpa/mastodon 2c9a1f7417 05/47: rework search into three separate views with view cycling on C-c C-c, ELPA Syncer, 2023/10/13