diff options
| author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-04-21 11:11:13 +0200 | 
|---|---|---|
| committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-04-21 11:11:13 +0200 | 
| commit | 96fc842db36d138b3d6cbd8d109c61fb6aa2cf6f (patch) | |
| tree | 6e97af912e96202b2e44e912ab9e2376d6d2bb13 /lisp | |
| parent | d8149443fafae6131a52443a0c5e333bf114aab2 (diff) | |
refactor tl--report-build-params and a hack test for it
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/mastodon-tl.el | 28 | 
1 files changed, 18 insertions, 10 deletions
| diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 0355a27..91cc989 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -2116,16 +2116,24 @@ Prefix is sent to `mastodon-tl--show-tag-timeline', which see."           (forward-p (when (y-or-n-p "Forward to remote admin? ") "true"))           (rules (when (y-or-n-p "Cite a rule broken? ")                    (mastodon-tl--read-rules-ids))) -         (cat (unless rules (if (y-or-n-p "Spam? ") "spam" "other"))) -         (params `(("account_id" . ,account-id) -                   ,(when comment -                      `("comment" . ,comment)) -                   ,(when toot-id -                      `("status_ids[]" . ,toot-id)) -                   ,(when forward-p -                      `("forward" . ,forward-p)) -                   ,(when cat -                      `("category" . ,cat))))) +         (cat (unless rules (if (y-or-n-p "Spam? ") "spam" "other")))) +    (mastodon-tl--report-build-params account-id comment toot-id +                                      forward-p cat rules))) + +(defun mastodon-tl--report-build-params +    (account-id comment toot-id forward-p cat &optional rules) +  "Build the parameters alist based on user responses. +ACCOUNT-ID, COMMENT, TOOD-ID, FORWARD-P, CAT, and RULES are all from +`mastodon-tl--report-params', which see." +  (let ((params `(("account_id" . ,account-id) +                  ,(when comment +                     `("comment" . ,comment)) +                  ,(when toot-id +                     `("status_ids[]" . ,toot-id)) +                  ,(when forward-p +                     `("forward" . ,forward-p)) +                  ,(when cat +                     `("category" . ,cat)))))      (when rules        (let ((alist               (mastodon-http--build-array-params-alist "rule_ids[]" rules))) | 
