1
0
Fork 0

- optimized expanding of status trees that contains mentions;

- fixed file path of Makefile.am;

- fixed typo.
This commit is contained in:
cage 2022-05-01 10:08:01 +02:00
parent fdfd9e5062
commit e07f4d2ee3
3 changed files with 25 additions and 21 deletions

View File

@ -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)

View File

@ -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

View File

@ -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)))