diff --git a/Makefile.am b/Makefile.am index e082606..4a6189b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,7 +36,7 @@ etc/init.lisp compare_version.awk SUBDIRS = po dist_doc_DATA = README.org README.txt LICENSES.org CONTRIBUTING.org \ -doc/man.org doc/send-toot.lisp NEWS.org ChangeLog AUTHORS +doc/tinmop.org doc/send-toot.lisp NEWS.org ChangeLog AUTHORS confdir = $(sysconfdir)/$(PACKAGE) diff --git a/Makefile.in b/Makefile.in index 49ecec7..dad6d77 100644 --- a/Makefile.in +++ b/Makefile.in @@ -401,7 +401,7 @@ etc/init.lisp compare_version.awk SUBDIRS = po dist_doc_DATA = README.org README.txt LICENSES.org CONTRIBUTING.org \ -doc/man.org doc/send-toot.lisp NEWS.org ChangeLog AUTHORS +doc/tinmop.org doc/send-toot.lisp NEWS.org ChangeLog AUTHORS confdir = $(sysconfdir)/$(PACKAGE) dist_conf_DATA = etc/init.lisp etc/default-theme.conf etc/shared.conf diff --git a/src/api-client.lisp b/src/api-client.lisp index 3d4e88d..d25e4f2 100644 --- a/src/api-client.lisp +++ b/src/api-client.lisp @@ -727,24 +727,28 @@ the latest 15 mentions)." mentions-so-far)) (defun update-mentions-folder (&key (delete-mentions-on-server t)) - (when-let* ((all-mentions (all-mentions)) - (trees (flatten (loop - for mention in all-mentions - when (tooter:status mention) - collect - (expand-status-tree (tooter:status mention))))) - (event (make-instance 'program-events:save-timeline-in-db-event - :payload trees - :timeline-type db:+home-timeline+ - :folder db:+mentions-status-folder+ - :localp t - :min-id nil))) - (when delete-mentions-on-server - (map nil - (lambda (m) (delete-notification (tooter:id m))) - all-mentions)) - (program-events:push-event event) - all-mentions)) + (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))) + (let ((event (make-instance 'program-events:save-timeline-in-db-event + :payload trees + :timeline-type db:+home-timeline+ + :folder db:+mentions-status-folder+ + :localp t + :min-id nil))) + (when delete-mentions-on-server + (loop for mention in all-mentions do + (delete-notification (tooter:id mention)))) + (program-events:push-event event) + all-mentions)))) (defun expand-status-thread (status-id timeline folder force-saving-of-ignored-status-p) (when-let* ((tree (expand-status-tree status-id)) @@ -789,7 +793,7 @@ node-status-id is not a leaf)." (expand-status-tree (tooter:id object))) (defmethod expand-status-tree ((object string)) - "Given a status id returns the complete mesaages tree this status belong." + "Given a status id returns the complete messages tree this status belong." (multiple-value-bind (root fetched-branch) (climb-fetch-statuses object) (let ((res (copy-list fetched-branch)))