1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2025-02-25 09:17:45 +01:00

- changed mentions saving, just save the posts where the user is mentioned, not the tree that contains the posts.

This commit is contained in:
cage 2023-05-31 16:35:21 +02:00
parent 5a399987c8
commit edab3dce36
2 changed files with 11 additions and 8 deletions

View File

@ -789,18 +789,20 @@ the latest 15 mentions)."
(tooter:account-name (tooter:account notification))))) (tooter:account-name (tooter:account notification)))))
(tui:make-tui-string raw-text))) (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 '())) (let ((trees '()))
(when-let* ((all-mentions (all-mentions)) (when-let* ((all-mentions (all-mentions))
(statuses (loop for mention in all-mentions (statuses (loop for mention in all-mentions
when (tooter:status mention) when (tooter:status mention)
collect (tooter:status mention)))) collect (tooter:status mention))))
(loop for status in statuses (if collect-threads
when (not (member status trees)) (loop for status in statuses
do when (not (member status trees))
(loop for node in (expand-status-tree status) do
do (loop for node in (expand-status-tree status)
(pushnew node trees))) do
(pushnew node trees)))
(setf trees statuses))
(let ((event (make-instance 'program-events:save-timeline-in-db-event (let ((event (make-instance 'program-events:save-timeline-in-db-event
:payload trees :payload trees
:timeline-type db:+home-timeline+ :timeline-type db:+home-timeline+

View File

@ -1067,7 +1067,8 @@
(defmethod process-event ((object update-mentions-event)) (defmethod process-event ((object update-mentions-event))
(let ((delete-fetched-mentions-required (swconf:config-delete-fetched-mentions-p))) (let ((delete-fetched-mentions-required (swconf:config-delete-fetched-mentions-p)))
(when-let* ((mentions (api-client:update-mentions-folder (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)) (mentions-count (length mentions))
(thread-window specials:*thread-window*)) (thread-window specials:*thread-window*))
(when command-line:*notify-mentions* (when command-line:*notify-mentions*