mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-05 04:57:40 +01:00
- optimized expanding of status trees that contains mentions;
- fixed file path of Makefile.am; - fixed typo.
This commit is contained in:
parent
fdfd9e5062
commit
e07f4d2ee3
@ -36,7 +36,7 @@ etc/init.lisp compare_version.awk
|
|||||||
SUBDIRS = po
|
SUBDIRS = po
|
||||||
|
|
||||||
dist_doc_DATA = README.org README.txt LICENSES.org CONTRIBUTING.org \
|
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)
|
confdir = $(sysconfdir)/$(PACKAGE)
|
||||||
|
|
||||||
|
@ -401,7 +401,7 @@ etc/init.lisp compare_version.awk
|
|||||||
|
|
||||||
SUBDIRS = po
|
SUBDIRS = po
|
||||||
dist_doc_DATA = README.org README.txt LICENSES.org CONTRIBUTING.org \
|
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)
|
confdir = $(sysconfdir)/$(PACKAGE)
|
||||||
dist_conf_DATA = etc/init.lisp etc/default-theme.conf etc/shared.conf
|
dist_conf_DATA = etc/init.lisp etc/default-theme.conf etc/shared.conf
|
||||||
|
@ -727,24 +727,28 @@ the latest 15 mentions)."
|
|||||||
mentions-so-far))
|
mentions-so-far))
|
||||||
|
|
||||||
(defun update-mentions-folder (&key (delete-mentions-on-server t))
|
(defun update-mentions-folder (&key (delete-mentions-on-server t))
|
||||||
|
(let ((trees '()))
|
||||||
(when-let* ((all-mentions (all-mentions))
|
(when-let* ((all-mentions (all-mentions))
|
||||||
(trees (flatten (loop
|
(statuses (loop for mention in all-mentions
|
||||||
for mention in all-mentions
|
|
||||||
when (tooter:status mention)
|
when (tooter:status mention)
|
||||||
collect
|
collect (tooter:status mention))))
|
||||||
(expand-status-tree (tooter:status mention)))))
|
(loop for status in statuses
|
||||||
(event (make-instance 'program-events:save-timeline-in-db-event
|
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
|
:payload trees
|
||||||
:timeline-type db:+home-timeline+
|
:timeline-type db:+home-timeline+
|
||||||
:folder db:+mentions-status-folder+
|
:folder db:+mentions-status-folder+
|
||||||
:localp t
|
:localp t
|
||||||
:min-id nil)))
|
:min-id nil)))
|
||||||
(when delete-mentions-on-server
|
(when delete-mentions-on-server
|
||||||
(map nil
|
(loop for mention in all-mentions do
|
||||||
(lambda (m) (delete-notification (tooter:id m)))
|
(delete-notification (tooter:id mention))))
|
||||||
all-mentions))
|
|
||||||
(program-events:push-event event)
|
(program-events:push-event event)
|
||||||
all-mentions))
|
all-mentions))))
|
||||||
|
|
||||||
(defun expand-status-thread (status-id timeline folder force-saving-of-ignored-status-p)
|
(defun expand-status-thread (status-id timeline folder force-saving-of-ignored-status-p)
|
||||||
(when-let* ((tree (expand-status-tree status-id))
|
(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)))
|
(expand-status-tree (tooter:id object)))
|
||||||
|
|
||||||
(defmethod expand-status-tree ((object string))
|
(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)
|
(multiple-value-bind (root fetched-branch)
|
||||||
(climb-fetch-statuses object)
|
(climb-fetch-statuses object)
|
||||||
(let ((res (copy-list fetched-branch)))
|
(let ((res (copy-list fetched-branch)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user