1
0
Fork 0

- added a configuration directive to leave or delete mentions from the server after fetching them.

This commit is contained in:
cage 2022-11-27 13:37:50 +01:00
parent c83f21a76f
commit 937d2faba5
5 changed files with 28 additions and 14 deletions

View File

@ -45,6 +45,10 @@ post-allowed-language = ".*"
# (default 'no', change to 'yes' if desired)
start.update.gemlog = no
# delete mentions fetched from the server
delete.fetched.mentions = yes
# directory to scan for gempub files, default the same as
# $XDG_DATA_HOME (usually something like %HOME/.local/share/tinmop/").

View File

@ -756,7 +756,6 @@ the latest 15 mentions)."
mentions-so-far))
(defun update-mentions-folder (&key (delete-mentions-on-server t))
(declare (ignorable delete-mentions-on-server)) ; because of the render macro '#-debug-mode'
(let ((trees '()))
(when-let* ((all-mentions (all-mentions))
(statuses (loop for mention in all-mentions
@ -774,7 +773,6 @@ the latest 15 mentions)."
:folder db:+mentions-status-folder+
:localp t
:min-id nil)))
#-debug-mode
(when delete-mentions-on-server
(loop for mention in all-mentions do
(delete-notification (tooter:id mention))))

View File

@ -1252,6 +1252,7 @@
:tree-config-rendering-values
:make-tree-colormap
:left-arrow
:config-delete-fetched-mentions-p
:config-gemini-fullscreen-toc-width
:config-gemini-fullscreen-links-height
:config-post-allowed-language

View File

@ -971,17 +971,19 @@
(defclass update-mentions-event (program-event) ())
(defmethod process-event ((object update-mentions-event))
(when-let* ((mentions (api-client:update-mentions-folder :delete-mentions-on-server t))
(mentions-count (length mentions))
(thread-window specials:*thread-window*))
(when command-line:*notify-mentions*
(loop for mention in mentions do
(thread-window:add-mention thread-window mention))
(ui:notify (format nil
(n_ "Got ~a notification"
"Got ~a notifications"
mentions-count)
mentions-count)))))
(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))
(mentions-count (length mentions))
(thread-window specials:*thread-window*))
(when command-line:*notify-mentions*
(loop for mention in mentions do
(thread-window:add-mention thread-window mention))
(ui:notify (format nil
(n_ "Got ~a notification"
"Got ~a notifications"
mentions-count)
mentions-count))))))
(defclass expand-thread-event (program-event event-with-timeline-and-folder)
((status-id

View File

@ -601,6 +601,8 @@
selected
unselected
deleted
fetched
delete
input
read
unread
@ -622,7 +624,8 @@
ignore-user-boost-re
post-allowed-language
purge-history-days-offset
purge-cache-days-offset)
purge-cache-days-offset
mentions)
(defun perform-missing-value-check (file)
(handler-case
@ -983,6 +986,12 @@
(,transform-value-fn (access:accesses *software-configuration*
,@keys))))
(gen-simple-access (delete-fetched-mentions-p
:transform-value-fn db-utils:db-not-nil-p)
+key-delete+
+key-fetched+
+key-mentions+)
(gen-simple-access (gemini-fullscreen-toc-width
:transform-value-fn main-window:parse-subwin-w)
+key-gemini+