aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-toot.el48
1 files changed, 25 insertions, 23 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index bc34bcd..c1deba7 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -1785,27 +1785,28 @@ REPLY-REGION is a string to be injected into the buffer."
(mastodon-toot--set-cw reply-cw))))
(defun mastodon-toot--warn-remote-suspension (reply-to-user)
- (let* ((domains
- (delete-dups
- (mapcar
- (lambda (user) (caddr (string-split user "@")))
- (string-split reply-to-user " "))))
- (suspended-by
- (seq-filter
- #'mastodon-tl--remote-suspended-p
- domains)))
- (cond ((length= domains (length suspended-by))
- (display-warning
- 'mastodon
- "All domains of user mentions in this reply draft have suspended you"
- :warning))
- (suspended-by
- (display-warning
- 'mastodon
- (format
- "Some domains of user mentions in this reply draft have suspended you: %s"
- (string-join suspended-by " "))
- :warning)))))
+ (when reply-to-user
+ (let* ((domains
+ (delete-dups
+ (mapcar
+ (lambda (user) (caddr (string-split user "@")))
+ (string-split reply-to-user " "))))
+ (suspended-by
+ (seq-filter
+ #'mastodon-tl--remote-suspended-p
+ domains)))
+ (cond ((length= domains (length suspended-by))
+ (display-warning
+ 'mastodon
+ "All domains of user mentions in this reply draft have suspended you"
+ :warning))
+ (suspended-by
+ (display-warning
+ 'mastodon
+ (format
+ "Some domains of user mentions in this reply draft have suspended you: %s"
+ (string-join suspended-by " "))
+ :warning))))))
(defun mastodon-toot--update-status-fields (&rest _args)
"Update the status fields in the header based on the current state."
@@ -2048,8 +2049,9 @@ EDIT means we are editing an existing toot, not composing a new one."
(mastodon-toot--display-docs-and-status-fields reply-text)
(mastodon-toot--fill-reply-in-compose))
(mastodon-toot--display-docs-and-status-fields))
- (setq reply-to-user (string-join
- (delete-dups (string-split reply-to-user " ")) " "))
+ (when reply-to-user
+ (setq reply-to-user (string-join
+ (delete-dups (string-split reply-to-user " ")) " ")))
;; `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