diff options
author | martianh <martianh@noreply.codeberg.org> | 2022-12-27 00:47:43 +0000 |
---|---|---|
committer | martianh <martianh@noreply.codeberg.org> | 2022-12-27 00:47:43 +0000 |
commit | 911f78658887857c8aeb36d38590895c6582f66d (patch) | |
tree | f13606360e521ef920fadddb9d11b5d9e2e0e737 /lisp/mastodon-toot.el | |
parent | eb0f38d2635872fca07ffc88b14a2dfe12807bc7 (diff) | |
parent | 017f9a8a8986b0cd5bca5d58f398f310048dab09 (diff) |
Merge pull request 'Only add scheduled_at parameter to toot params when non-nil' (#356) from tohojo/mastodon.el:conditional-scheduled into develop
Reviewed-on: https://codeberg.org/martianh/mastodon.el/pulls/356
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r-- | lisp/mastodon-toot.el | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index eab0dfd..c18f751 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -703,6 +703,8 @@ instance to edit a toot." (interactive) (let* ((edit-p (if mastodon-toot--edit-toot-id t nil)) (toot (mastodon-toot--remove-docs)) + (scheduled mastodon-toot--scheduled-for) + (scheduled-id mastodon-toot--scheduled-id) (endpoint (if edit-p ;; we are sending an edit: @@ -713,14 +715,16 @@ instance to edit a toot." mastodon-toot--content-warning) (read-string "Warning: " mastodon-toot--content-warning-from-reply-or-redraft))) - (args-no-media `(("status" . ,toot) - ("in_reply_to_id" . ,mastodon-toot--reply-to-id) - ("visibility" . ,mastodon-toot--visibility) - ("sensitive" . ,(when mastodon-toot--content-nsfw - (symbol-name t))) - ("spoiler_text" . ,spoiler) - ("language" . ,mastodon-toot--language) - ("scheduled_at" . ,mastodon-toot--scheduled-for))) + (args-no-media (append `(("status" . ,toot) + ("in_reply_to_id" . ,mastodon-toot--reply-to-id) + ("visibility" . ,mastodon-toot--visibility) + ("sensitive" . ,(when mastodon-toot--content-nsfw + (symbol-name t))) + ("spoiler_text" . ,spoiler) + ("language" . ,mastodon-toot--language)) + ; Pleroma instances can't handle null-valued + ; scheduled_at args, so only add if non-nil + (when scheduled `(("scheduled_at" . ,scheduled))))) (args-media (when mastodon-toot--media-attachments (mastodon-http--build-array-params-alist "media_ids[]" @@ -733,9 +737,7 @@ instance to edit a toot." (if mastodon-toot-poll (append args-no-media args-poll) args-no-media))) - (prev-window-config mastodon-toot-previous-window-config) - (scheduled mastodon-toot--scheduled-for) - (scheduled-id mastodon-toot--scheduled-id)) + (prev-window-config mastodon-toot-previous-window-config)) (cond ((and mastodon-toot--media-attachments ;; make sure we have media args ;; and the same num of ids as attachments |