From 93ef38d88b277e8d5991e887034a7622879c91b1 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 24 Mar 2023 09:33:37 +0100 Subject: FIX #418. set-cw check for nil as well as string-empty set-cw is called by setup-as-reply, which always runs in --compose-buffer. perhaps it shouldn't. --- lisp/mastodon-toot.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 82a9482..65fc357 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -591,7 +591,8 @@ NO-REDRAFT means delete toot only." (defun mastodon-toot--set-cw (&optional cw) "Set content warning to CW if it is non-nil." - (unless (string-empty-p cw) + (unless (or (null cw) ; cw is nil for `mastodon-tl--dm-user' + (string-empty-p cw)) (setq mastodon-toot--content-warning t) (setq mastodon-toot--content-warning-from-reply-or-redraft cw))) @@ -1637,6 +1638,10 @@ EDIT means we are editing an existing toot, not composing a new one." (mastodon-toot--display-docs-and-status-fields (when mastodon-toot-display-orig-in-reply-buffer reply-text)) + ;; `reply-to-user' (alone) is also used by `mastodon-tl--dm-user', so + ;; perhaps we should not always call --setup-as-reply, or make its + ;; workings conditional on reply-to-id. currently it only checks for + ;; reply-to-user. (mastodon-toot--setup-as-reply reply-to-user reply-to-id reply-json)) (unless mastodon-toot--max-toot-chars ;; no need to fetch from `mastodon-profile-account-settings' as -- cgit v1.2.3