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