1
0
Fork 0

- [TUI] notify when a parsing error occurred when querying local database.

This commit is contained in:
cage 2024-06-24 12:18:06 +02:00
parent 1f58010447
commit 883d2c0105
1 changed files with 25 additions and 24 deletions

View File

@ -2038,30 +2038,31 @@
(defmethod process-event ((object fediverse-local-query-event))
(with-accessors ((payload payload)) object
(multiple-value-bind (statuses destination-folder)
(fediverse-post-local-search:parse-search-statuses payload)
(let ((folder (or destination-folder
(query-results-folder-name))))
(loop for status in statuses do
(let* ((status-id (db:row-message-status-id status))
(status-row (db:find-status-id status-id)))
(when (not (db::find-status-id-folder-timeline status-id
folder
db:+home-timeline+))
(setf (getf status-row :folder)
folder)
(setf (getf status-row :timeline)
db:+home-timeline+)
(multiple-value-bind (query column-values)
(db-utils:insert-query db:+table-status+ status-row)
(db-utils:query-low-level query column-values)))))
(db:renumber-timeline-message-index db:+home-timeline+
folder
:account-id nil)
(let ((refresh-event (make-instance 'refresh-thread-windows-event
:new-folder folder
:new-timeline db:+home-timeline+)))
(push-event refresh-event))))))
(tui-utils:with-notify-errors
(multiple-value-bind (statuses destination-folder)
(fediverse-post-local-search:parse-search-statuses payload)
(let ((folder (or destination-folder
(query-results-folder-name))))
(loop for status in statuses do
(let* ((status-id (db:row-message-status-id status))
(status-row (db:find-status-id status-id)))
(when (not (db::find-status-id-folder-timeline status-id
folder
db:+home-timeline+))
(setf (getf status-row :folder)
folder)
(setf (getf status-row :timeline)
db:+home-timeline+)
(multiple-value-bind (query column-values)
(db-utils:insert-query db:+table-status+ status-row)
(db-utils:query-low-level query column-values)))))
(db:renumber-timeline-message-index db:+home-timeline+
folder
:account-id nil)
(let ((refresh-event (make-instance 'refresh-thread-windows-event
:new-folder folder
:new-timeline db:+home-timeline+)))
(push-event refresh-event)))))))
;;;; end events