diff options
author | mousebot <mousebot@riseup.net> | 2022-01-12 15:11:44 +0100 |
---|---|---|
committer | mousebot <mousebot@riseup.net> | 2022-01-20 17:33:38 +0100 |
commit | 6d9473d8a098a23d40e9fcf2c85ccedcbc1721d2 (patch) | |
tree | 408d6f36d7135d94371ddd2e7adc1d290362b6d1 /lisp/mastodon-toot.el | |
parent | 6113fa77d1cceb5bfe06d016dc2c81850c4b498e (diff) |
keep mastodon-toot--max-toot-chars a number not a string.
we use it as a number various times so let's leave it a number, then convert
to string for display in toot info.
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r-- | lisp/mastodon-toot.el | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 22699f1..746b7d4 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -170,8 +170,7 @@ Valid values are \"direct\", \"private\" (followers-only), (alist-get 'statuses (alist-get 'configuration json-response)))))) - (setq mastodon-toot--max-toot-chars - (number-to-string max-chars)) + (setq mastodon-toot--max-toot-chars max-chars) (with-current-buffer "*new toot*" (mastodon-toot--update-status-fields)))) @@ -501,7 +500,7 @@ If media items have been attached and uploaded with (length mastodon-toot--media-attachment-ids))))) (message "Something is wrong with your uploads. Wait for them to complete or try again.")) ((and mastodon-toot--max-toot-chars - (> (length toot) (string-to-number mastodon-toot--max-toot-chars))) + (> (length toot) mastodon-toot--max-toot-chars)) (message "Looks like your toot is longer than that maximum allowed length.")) (empty-toot-p (message "Empty toot. Cowardly refusing to post this.")) @@ -857,7 +856,7 @@ REPLY-JSON is the full JSON of the toot being replied to." (list 'display (format "%s/%s characters" (- (point-max) (cdr header-region)) - mastodon-toot--max-toot-chars))) + (number-to-string mastodon-toot--max-toot-chars)))) (add-text-properties (car visibility-region) (cdr visibility-region) (list 'display (format "Visibility: %s" |