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))) :payload attachment)))
(push-event add-event) (push-event add-event)
(attach-add))) (attach-add)))
(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))))
(on-add-attach (attach-path) (on-add-attach (attach-path)
(if (string-not-empty-p attach-path) (if (string-not-empty-p attach-path)
(progn (confirm-attach attach-path)
(if (fs:file-exists-p attach-path)
(setf (attachment-path attachment) attach-path)
(error-message (format nil
(_ "File ~s does not exists.")
attach-path)))
(ask-string-input #'on-alt-text
:prompt (_ "Add caption: ")))
(info-message (_ "Message ready to be sent"))))) (info-message (_ "Message ready to be sent")))))
(ask-string-input #'on-add-attach (ask-string-input #'on-add-attach
:prompt (_ "Add attachment: ") :prompt (_ "Add attachment: ")