1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2024-12-21 23:43:54 +01:00

- prevented inserting a duplicate row into search results folder.

This commit is contained in:
cage 2024-06-15 14:02:03 +02:00
parent 0b73087e4d
commit c4aa8850a7

View File

@ -2034,16 +2034,19 @@
(defmethod process-event ((object fediverse-local-query-event))
(with-accessors ((payload payload)) object
(loop for status-results in (fediverse-post-local-search:parse-search-statuses payload)
do
(let ((status-row (db:find-status-id (db:row-message-status-id status-results))))
(setf (getf status-row :folder)
(query-results-folder-name))
(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))))
(loop for status-results in (fediverse-post-local-search:parse-search-statuses payload) do
(let* ((status-id (db:row-message-status-id status-results))
(status-row (db:find-status-id status-id)))
(when (not (db::find-status-id-folder-timeline status-id
(query-results-folder-name)
db:+home-timeline+))
(setf (getf status-row :folder)
(query-results-folder-name))
(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)))))
(let ((refresh-event (make-instance 'refresh-thread-windows-event
:new-folder (query-results-folder-name)
:new-timeline db:+home-timeline+)))