mirror of
https://codeberg.org/cage/tinmop/
synced 2024-12-21 23:43:54 +01:00
- prevented crash when removing two (or more) statuses that reblogged the same status.
When more than one statuses points to the same reblogged status and more the one of the formers is deleted the first deletion will remove the reblogged status as well and the second will try to remove the same (already removed from db) status. This makes the program crash.
This commit is contained in:
parent
e191ef7f79
commit
b3c3d8a232
16
src/db.lisp
16
src/db.lisp
@ -2320,9 +2320,19 @@ where all parent messages are saved."
|
||||
(let ((marked-to-delete (statuses-marked-to-delete timeline folder)))
|
||||
(loop for status-to-delete in marked-to-delete do
|
||||
(when-let ((reblogged-id (row-message-reblog-id status-to-delete)))
|
||||
(delete-status +default-reblogged-timeline+
|
||||
+default-reblogged-folder+
|
||||
reblogged-id))
|
||||
;; sometimes a status is reblogged by more than
|
||||
;; one of the statuses that you downloaded and if
|
||||
;; you delete at least two of the latter the first
|
||||
;; deletion will remove also the reblogged status,
|
||||
;; so the other statuses should skip deletion of
|
||||
;; the reblogged one as it has been already
|
||||
;; removed
|
||||
(when (find-status-id-folder-timeline reblogged-id
|
||||
+default-reblogged-folder+
|
||||
+default-reblogged-timeline+)
|
||||
(delete-status +default-reblogged-timeline+
|
||||
+default-reblogged-folder+
|
||||
reblogged-id)))
|
||||
(delete-status timeline folder (row-message-status-id status-to-delete))))))))
|
||||
|
||||
(defun max-username-length (timeline-type folder)
|
||||
|
Loading…
Reference in New Issue
Block a user