From d551505165df060550ad5ddce196df2e797a43d9 Mon Sep 17 00:00:00 2001 From: cage Date: Sat, 7 Sep 2024 19:29:54 +0200 Subject: [PATCH] - [fediverse] ensured :follow-request and :mentions are kept on the server when deleting noticfications. --- src/api-client.lisp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/api-client.lisp b/src/api-client.lisp index 1adef77..e7a3bff 100644 --- a/src/api-client.lisp +++ b/src/api-client.lisp @@ -820,12 +820,15 @@ numerical indices identifying the option voting for" :status :update)) +(defun safe-to-delete-notifications-type () + (remove-if (lambda (a) + (member a + '(:mention :follow-request))) + *all-notification-types*)) + (defun notifications (max-id &optional - (excluded-types (remove-if (lambda (a) - (member a - '(:mention :follow-request))) - *all-notification-types*))) + (excluded-types (safe-to-delete-notifications-type))) "Get the latest mentions, starting from `max-id` (pass nil to get the latest 15 mentions)." (get-notifications :max-id max-id @@ -871,7 +874,7 @@ the latest 15 mentions)." notifications-so-far)) (defun delete-all-notifications (&optional (progress-fn nil)) - (when-let ((notifications (all-notifications nil))) + (when-let ((notifications (all-notifications (safe-to-delete-notifications-type)))) (loop for notification in notifications do (delete-notification (tooter:id notification)) (when (functionp progress-fn)