From f2af3a64967c403145c9b32aefd08ea8932a4770 Mon Sep 17 00:00:00 2001 From: mousebot Date: Wed, 15 Dec 2021 12:54:58 +0100 Subject: attach media test before post just test that length of --media-attachments == length of --media-attachment-ids. --- lisp/mastodon-toot.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 6eac981..9a88bd5 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -463,11 +463,14 @@ If media items have been attached and uploaded with (symbol-name t))) ("spoiler_text" . ,spoiler))) (args-media (when mastodon-toot--media-attachments + (if (= (length mastodon-toot--media-attachments) + (length mastodon-toot--media-attachment-ids)) ;; (mastodon-toot--upload-attached-media) ;; moved upload to mastodon-toot--attach-media - (mapcar (lambda (id) - (cons "media_ids[]" id)) - mastodon-toot--media-attachment-ids))) + (mapcar (lambda (id) + (cons "media_ids[]" id)) + mastodon-toot--media-attachment-ids) + (message "Looks like something went wrong with your uploads. Maybe you want to try again.")))) (args (append args-media args-no-media))) (if (> (length toot) (string-to-number mastodon-toot--max-toot-chars)) (message "Looks like your toot is longer than that maximum allowed length.") -- cgit v1.2.3