aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2021-10-22 14:21:16 +0200
committermousebot <mousebot@riseup.net>2021-10-22 14:21:16 +0200
commit0a3bf6fcd92a52e8b3988f470fbf73a03a391739 (patch)
treefc711f2de52665930cfba09280f34c348403f6fd /lisp
parent6c53da8c494367bd1f36f1e28d75c209713a13dd (diff)
don't allow posts longer than server's max_toot_chars length
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-toot.el16
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index d4068ea..0153c9b 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -401,13 +401,15 @@ If media items have been uploaded with `mastodon-toot--add-media-attachment', at
(if (and mastodon-toot--media-attachments
(equal mastodon-toot--media-attachment-ids nil))
(message "Looks like your uploads are not up: C-c C-u to upload...")
- (if empty-toot-p
- (message "Empty toot. Cowardly refusing to post this.")
- (let ((response (mastodon-http--post endpoint args nil)))
- (mastodon-http--triage response
- (lambda ()
- (mastodon-toot--kill)
- (message "Toot toot!"))))))))
+ (if (> (length toot) (string-to-number mastodon-toot--max-toot-chars))
+ (message "Looks like your toot is longer than that maximum allowed length.")
+ (if empty-toot-p
+ (message "Empty toot. Cowardly refusing to post this.")
+ (let ((response (mastodon-http--post endpoint args nil)))
+ (mastodon-http--triage response
+ (lambda ()
+ (mastodon-toot--kill)
+ (message "Toot toot!")))))))))
(defun mastodon-toot--process-local (acct)
"Add domain to local ACCT and replace the curent user name with \"\".