1
0
Fork 0

- prevented crash when mark or unmark for deletion an empty thread window.

This commit is contained in:
cage 2021-09-10 18:26:12 +02:00
parent ae266982cb
commit 9b8aa8bd93
2 changed files with 17 additions and 11 deletions

View File

@ -2129,9 +2129,9 @@ reblogged (if exists)."
(= value +db-false+)))
(let ((query (update :status
(set= column value)
(where (:and (:= :timeline timeline)
(:= :folder folder)
(:= :status-id status-id))))))
(where (:and (:= :timeline timeline)
(:= :folder folder)
(:= :status-id status-id))))))
(query query)))
(defun mark-status-red-p (timeline folder status-id)

View File

@ -882,17 +882,23 @@ db:renumber-timeline-message-index."
(defmethod mark-selected-message-to-delete ((object thread-window)
&key (move-down-selected-message nil))
(mark-selected-status-boolean-value object #'db:mark-status-deleted-p)
(resync-rows-db object :redraw t)
(when move-down-selected-message
(go-message-down object)))
(if (selected-row object)
(progn
(mark-selected-status-boolean-value object #'db:mark-status-deleted-p)
(resync-rows-db object :redraw t)
(when move-down-selected-message
(go-message-down object)))
(ui:error-message (_ "No message to delete"))))
(defmethod mark-selected-message-prevent-delete ((object thread-window)
&key (move-down-selected-message nil))
(mark-selected-status-boolean-value object #'db:mark-status-prevent-deletion)
(resync-rows-db object :redraw t)
(when move-down-selected-message
(go-message-down object)))
(if (selected-row object)
(progn
(mark-selected-status-boolean-value object #'db:mark-status-prevent-deletion)
(resync-rows-db object :redraw t)
(when move-down-selected-message
(go-message-down object)))
(ui:error-message (_ "No message to undelete"))))
(defun rebuild-lines (window message-id)
(multiple-value-bind (tree pos)