diff options
author | marty hiatt <martianhiatus@riseup.net> | 2024-08-02 20:38:11 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus@riseup.net> | 2024-08-02 20:38:26 +0200 |
commit | 731f7b5295e7169f51b2cebf767bb3acefbcda96 (patch) | |
tree | 916762404cddea7d0a3473eb6d512b70dff2ad0b /lisp/mastodon-toot.el | |
parent | 1c1085a321a0885431e7eac5f720b6b0bedd797e (diff) |
re-write --reply again with a cond.
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r-- | lisp/mastodon-toot.el | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 166f08b..277b9c4 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -1167,7 +1167,6 @@ prefixed by >." (let* ((quote (when (region-active-p) (buffer-substring (region-beginning) (region-end)))) - ;; no-move arg for base toot: don't try next toot (toot (mastodon-toot--base-toot-or-item-json)) (account (mastodon-tl--field 'account toot)) (user (alist-get 'acct account)) @@ -1175,22 +1174,20 @@ prefixed by >." (boosted (mastodon-tl--field 'reblog toot)) (booster (when boosted (alist-get 'acct - (alist-get 'account toot))))) - (mastodon-toot--compose-buffer - (when user - (if (and booster - ;; (if - (and (not (equal user booster)) - (not (member booster mentions)))) - ;; different booster, user and mentions: - (mastodon-toot--mentions-to-string (append (list user booster) mentions nil)) - ;; booster is either user or in mentions or nil: - (if (not (member user mentions)) - ;; user not already in mentions: - (mastodon-toot--mentions-to-string (append (list user) mentions nil)) - ;; user already in mentions: - (mastodon-toot--mentions-to-string (copy-sequence mentions))))) - id toot quote)))) + (alist-get 'account toot)))) + (mentions + (cond ((and booster ;; different booster, user and mentions: + (and (not (equal user booster)) + (not (member booster mentions)))) + (mastodon-toot--mentions-to-string + (append (list user booster) mentions nil))) + ((not (member user mentions)) ;; user not in mentions: + (mastodon-toot--mentions-to-string + (append (list user) mentions nil))) + (t ;; user already in mentions: + (mastodon-toot--mentions-to-string + (copy-sequence mentions)))))) + (mastodon-toot--compose-buffer mentions id toot quote)))) ;;; COMPOSE TOOT SETTINGS |