1
0
Fork 0

- added preview and confirm prompt for each file attached on a status.

This commit is contained in:
cage 2022-11-15 20:16:04 +01:00
parent 7186382c40
commit 65c9ac64d0
1 changed files with 19 additions and 8 deletions

View File

@ -1173,16 +1173,27 @@ It an existing file path is provided the command will refuse to run."
:payload attachment)))
(push-event add-event)
(attach-add)))
(on-add-attach (attach-path)
(if (string-not-empty-p attach-path)
(progn
(on-attach-confirmed (maybe-accepted)
(with-valid-yes-at-prompt (maybe-accepted y-pressed-p)
(when y-pressed-p
(ask-string-input #'on-alt-text
:prompt (_ "Add caption: ")))))
(confirm-attach (attach-path)
(if (fs:file-exists-p attach-path)
(progn
(setf (attachment-path attachment) attach-path)
(croatoan:end-screen)
(tui:with-notify-errors
(os-utils:xdg-open attach-path))
(ask-string-input #'on-attach-confirmed
:prompt
(format nil (_ "Attach ~a? [y/N] ") attach-path)))
(error-message (format nil
(_ "File ~s does not exists.")
attach-path)))
(ask-string-input #'on-alt-text
:prompt (_ "Add caption: ")))
attach-path))))
(on-add-attach (attach-path)
(if (string-not-empty-p attach-path)
(confirm-attach attach-path)
(info-message (_ "Message ready to be sent")))))
(ask-string-input #'on-add-attach
:prompt (_ "Add attachment: ")