aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-toot.el
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2021-12-15 12:54:58 +0100
committermousebot <mousebot@riseup.net>2021-12-15 12:54:58 +0100
commitf2af3a64967c403145c9b32aefd08ea8932a4770 (patch)
tree555d813102b1d2ab51d4ba7a0a5fd9e18d2a9ab3 /lisp/mastodon-toot.el
parent2259577b8616005fd0265e211ae63188f4b32a3d (diff)
attach media test before post
just test that length of --media-attachments == length of --media-attachment-ids.
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r--lisp/mastodon-toot.el9
1 files changed, 6 insertions, 3 deletions
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.")