aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormousebot <mousebot@riseup.net>2021-05-13 10:07:21 +0200
committermousebot <mousebot@riseup.net>2021-05-13 10:07:21 +0200
commitf7ece61db5c6ad11cfc90dba7951448ec292183a (patch)
tree61783950e1394fc44fc8e5d752bf988486b5d1c3
parent5b7e7f1f7154e096469125daa96c16346ebeca9c (diff)
implmement mentioning boosters in replies by default
-rw-r--r--lisp/mastodon-toot.el26
1 files changed, 22 insertions, 4 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 14264dc..4e57158 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -233,7 +233,11 @@ eg. \"feduser@fed.social\" -> \"feduser@fed.social\" "
(defun mastodon-toot--mentions (status)
"Extract mentions from STATUS and process them into a string."
(interactive)
- (let ((mentions (cdr (assoc 'mentions status))))
+ (let* ((boosted (mastodon-tl--field 'reblog status))
+ (mentions
+ (if boosted
+ (cdr (assoc 'mentions (cdr (assoc 'reblog status))))
+ (cdr (assoc 'mentions status)))))
(mapconcat (lambda(x) (mastodon-toot--process-local
(cdr (assoc 'acct x))))
;; reverse does not work on vectors in 24.5
@@ -247,9 +251,23 @@ eg. \"feduser@fed.social\" -> \"feduser@fed.social\" "
(id (mastodon-tl--as-string (mastodon-tl--field 'id toot)))
(account (mastodon-tl--field 'account toot))
(user (cdr (assoc 'acct account)))
- (mentions (mastodon-toot--mentions toot)))
- (mastodon-toot (when user (concat (mastodon-toot--process-local user)
- mentions))
+ (mentions (mastodon-toot--mentions toot))
+ (boosted (mastodon-tl--field 'reblog toot))
+ (booster (when boosted
+ (cdr (assoc 'acct
+ (cdr (assoc 'account toot)))))))
+ (mastodon-toot (when user
+ (if booster
+ (if (and
+ (not (equal user booster))
+ (not (string-match booster mentions)))
+ (concat (mastodon-toot--process-local user)
+ ;; "@" booster " "
+ (mastodon-toot--process-local booster) mentions)
+ (concat (mastodon-toot--process-local user)
+ mentions))
+ (concat (mastodon-toot--process-local user)
+ mentions)))
id)))
(defun mastodon-toot--toggle-warning ()