diff options
author | Toke Høiland-Jørgensen <toke@toke.dk> | 2022-12-16 16:54:06 +0100 |
---|---|---|
committer | Toke Høiland-Jørgensen <toke@toke.dk> | 2022-12-26 19:34:14 +0100 |
commit | 017f9a8a8986b0cd5bca5d58f398f310048dab09 (patch) | |
tree | f13606360e521ef920fadddb9d11b5d9e2e0e737 /lisp | |
parent | eb0f38d2635872fca07ffc88b14a2dfe12807bc7 (diff) |
Only add scheduled_at parameter to toot params when non-nil
The Pleroma server software can't handle the scheduled_at parameter being
set to anything other than a valid datetime, even an empty value. To work
around this, change mastodon-toot--send to only add the parameter to the
list of args if its non-nil.
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Diffstat (limited to 'lisp')
-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 |