From edab3dce361e577977a120fb9a886f4e51b7dda7 Mon Sep 17 00:00:00 2001 From: cage Date: Wed, 31 May 2023 16:35:21 +0200 Subject: [PATCH] - changed mentions saving, just save the posts where the user is mentioned, not the tree that contains the posts. --- src/api-client.lisp | 16 +++++++++------- src/program-events.lisp | 3 ++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/api-client.lisp b/src/api-client.lisp index 7defcd8..a070393 100644 --- a/src/api-client.lisp +++ b/src/api-client.lisp @@ -789,18 +789,20 @@ the latest 15 mentions)." (tooter:account-name (tooter:account notification))))) (tui:make-tui-string raw-text))) -(defun update-mentions-folder (&key (delete-mentions-on-server t)) +(defun update-mentions-folder (&key (delete-mentions-on-server t) (collect-threads t)) (let ((trees '())) (when-let* ((all-mentions (all-mentions)) (statuses (loop for mention in all-mentions when (tooter:status mention) collect (tooter:status mention)))) - (loop for status in statuses - when (not (member status trees)) - do - (loop for node in (expand-status-tree status) - do - (pushnew node trees))) + (if collect-threads + (loop for status in statuses + when (not (member status trees)) + do + (loop for node in (expand-status-tree status) + do + (pushnew node trees))) + (setf trees statuses)) (let ((event (make-instance 'program-events:save-timeline-in-db-event :payload trees :timeline-type db:+home-timeline+ diff --git a/src/program-events.lisp b/src/program-events.lisp index 9c4609c..ecd792d 100644 --- a/src/program-events.lisp +++ b/src/program-events.lisp @@ -1067,7 +1067,8 @@ (defmethod process-event ((object update-mentions-event)) (let ((delete-fetched-mentions-required (swconf:config-delete-fetched-mentions-p))) (when-let* ((mentions (api-client:update-mentions-folder - :delete-mentions-on-server delete-fetched-mentions-required)) + :delete-mentions-on-server delete-fetched-mentions-required + :collect-threads nil)) (mentions-count (length mentions)) (thread-window specials:*thread-window*)) (when command-line:*notify-mentions*