mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-22 08:57:37 +01:00
- added version 2 of get chat list endpoint.
This commit is contained in:
parent
7b3a97a3ec
commit
ae178546b9
@ -307,9 +307,9 @@ Returns nil if the user did not provided a server in the configuration file"
|
|||||||
(program-events:push-event add-fetched-event))))
|
(program-events:push-event add-fetched-event))))
|
||||||
|
|
||||||
(defun-api-call update-timeline (timeline
|
(defun-api-call update-timeline (timeline
|
||||||
kind
|
kind
|
||||||
folder
|
folder
|
||||||
&key
|
&key
|
||||||
recover-from-skipped-statuses
|
recover-from-skipped-statuses
|
||||||
local
|
local
|
||||||
only-media
|
only-media
|
||||||
|
@ -25,6 +25,37 @@
|
|||||||
"/api/v1/pleroma/chats/by-account-id/~a"
|
"/api/v1/pleroma/chats/by-account-id/~a"
|
||||||
account-id))))
|
account-id))))
|
||||||
|
|
||||||
|
|
||||||
|
(defgeneric get-chats-list (object &key with-muted-p max-id min-id since-id offset limits))
|
||||||
|
|
||||||
|
(defmethod get-chats-list ((object tooter:client)
|
||||||
|
&key
|
||||||
|
(with-muted-p t)
|
||||||
|
(max-id nil)
|
||||||
|
(min-id nil)
|
||||||
|
(since-id nil)
|
||||||
|
(offset 0)
|
||||||
|
(limits 200))
|
||||||
|
"Get a list of all chats, ordered from the more recent updated. Note: uses version 2 of the API."
|
||||||
|
(decode-chat (tooter:query object
|
||||||
|
"/api/v2/pleroma/chats"
|
||||||
|
:with-muted with-muted-p
|
||||||
|
:max-id max-id
|
||||||
|
:min-id min-id
|
||||||
|
:since-id since-id
|
||||||
|
:offset offset
|
||||||
|
:limits limits)))
|
||||||
|
|
||||||
|
(defgeneric get-all-chats-v2 (object min-id &key &allow-other-keys))
|
||||||
|
|
||||||
|
(defmethod get-all-chats-v2 ((object tooter:client) min-id &key (accum ()))
|
||||||
|
"Get a list of all chats, ordered from the more recent updated."
|
||||||
|
(let ((chats (api-client:sort-id< (get-chats-list object))))
|
||||||
|
(if chats
|
||||||
|
(let ((new-min-id (tooter:id (last-elt chats))))
|
||||||
|
(get-all-chats-v2 object object new-min-id (append chats accum)))
|
||||||
|
(api-client:sort-id< accum))))
|
||||||
|
|
||||||
(defgeneric get-all-chats (object))
|
(defgeneric get-all-chats (object))
|
||||||
|
|
||||||
(defmethod get-all-chats ((object tooter:client))
|
(defmethod get-all-chats ((object tooter:client))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user