From 0087e2c3635931e5f442983dbefce5d659d5842d Mon Sep 17 00:00:00 2001 From: cage Date: Wed, 10 Jul 2024 21:48:34 +0200 Subject: [PATCH] - ensured no reconstruction of parents id done when deleting a status after remote editing; - removed status to ensure get the latest version from the server when updating a timeline or expanding a thread (and forcing ignoring of logical deleted posts). --- src/db.lisp | 8 ++++++++ src/package.lisp | 2 ++ src/program-events.lisp | 5 +++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/db.lisp b/src/db.lisp index dd55099..3ba346d 100644 --- a/src/db.lisp +++ b/src/db.lisp @@ -2515,6 +2515,14 @@ to `timeline' , `folder' and possibly `account-id', older than (:= :folder folder) (:= :status-id (row-message-status-id child))))))))) +(defun remove-status-row (timeline-type folder status-id) + "delete status row" + (let ((query-delete (delete-from :status + (where (:and (:= :timeline timeline-type) + (:= :folder folder) + (:= :status-id status-id)))))) + (query query-delete))) + (defun count-status-marked-to-delete () (second (fetch-single (select (fields (:count :status-id)) (from :status) diff --git a/src/package.lisp b/src/package.lisp index bfb06b0..090a53f 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -1107,6 +1107,8 @@ :add-to-status-skipped :remove-from-status-skipped :remove-from-status-ignored + :delete-status + :remove-status-row :add-to-followers :remove-from-followers :forget-all-statuses-marked-deleted diff --git a/src/program-events.lisp b/src/program-events.lisp index 2c32619..55b0069 100644 --- a/src/program-events.lisp +++ b/src/program-events.lisp @@ -515,7 +515,8 @@ (db::concat-tags status))) (skip-this-status nil)) (when force-saving-of-ignored-status-p - (db:remove-from-status-ignored status-id folder timeline-type)) + (db:remove-from-status-ignored status-id folder timeline-type) + (db:remove-status-row timeline-type folder status-id)) (when (or (and (db:user-ignored-p account-id) (not (db:status-skipped-p status-id folder timeline-type))) (and language @@ -2102,7 +2103,7 @@ (ui:notify (_ "Editing post…")) (client:edit-status status-id new-content nil nil nil nil) (db:remove-from-status-ignored status-id folder timeline) - (db::delete-status timeline folder status-id) + (db:remove-status-row timeline folder status-id) (let* ((refresh-event (make-instance 'refresh-thread-windows-event :priority (1+ +standard-event-priority+) :message-status-id status-id))