1
0
Fork 0

- prevented to replace a post's content with an empty text.

This commit is contained in:
cage 2024-07-20 18:30:48 +02:00
parent 97988ec705
commit 36e380f31e
1 changed files with 22 additions and 20 deletions

View File

@ -2098,26 +2098,28 @@
(write-sequence text stream))
(croatoan:end-screen)
(tui:with-notify-errors
(os-utils:open-with-editor temp-file))
(let ((new-content (fs:slurp-file temp-file)))
(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: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))
(remote-edited-status (client:get-remote-status status-id))
(save-event (make-instance 'program-events:save-timeline-in-db-event
:payload (list remote-edited-status)
:timeline-type timeline
:folder folder
:force-saving-of-ignored-status t)))
(push-event save-event)
(push-event refresh-event)
(with-enqueued-process (+minimum-event-priority+)
(ui:thread-open-selected-message)
(ui:notify (_ "Post modified")))))))))
(os-utils:open-with-editor temp-file))
(when (> (fs:file-size temp-file)
0)
(let ((new-content (fs:slurp-file temp-file)))
(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: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))
(remote-edited-status (client:get-remote-status status-id))
(save-event (make-instance 'program-events:save-timeline-in-db-event
:payload (list remote-edited-status)
:timeline-type timeline
:folder folder
:force-saving-of-ignored-status t)))
(push-event save-event)
(push-event refresh-event)
(with-enqueued-process (+minimum-event-priority+)
(ui:thread-open-selected-message)
(ui:notify (_ "Post modified"))))))))))
;;;; end events