From 4046f516f878ff30beeb3e5aaa4f6e5e076cf73e Mon Sep 17 00:00:00 2001 From: cage Date: Wed, 2 Sep 2020 17:17:16 +0200 Subject: [PATCH] - [pleroma-API] added 'fetch-chat-message. --- src/api-pleroma.lisp | 9 +++++++++ src/package.lisp | 1 + 2 files changed, 10 insertions(+) diff --git a/src/api-pleroma.lisp b/src/api-pleroma.lisp index 562a44c..f510db7 100644 --- a/src/api-pleroma.lisp +++ b/src/api-pleroma.lisp @@ -126,6 +126,15 @@ media `media'. Returns a `chat-message' instance" :media-id (tooter:id (tooter:make-media object path-media)))))) +(defgeneric fetch-chat-messages (object chat-id &key min-id)) + +(defmethod fetch-chat-messages ((object tooter:client) chat-id &key (min-id nil)) + (decode-chat-message (tooter:query object + (format nil + "/api/v1/pleroma/chats/~a/messages" + chat-id) + :min-id min-id))) + (defgeneric delete-chat-message (object chat-id message-id)) (defmethod delete-chat-message ((object tooter:client) (chat-id string) (message-id string)) diff --git a/src/package.lisp b/src/package.lisp index 77909af..0713570 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -1244,6 +1244,7 @@ :create-chat :get-all-chats :post-chat-message + :fetch-chat-messages :delete-chat-message)) (defpackage :api-client