diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-07-25 14:17:18 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-07-25 14:17:18 +0200 |
commit | 20dec8871c9bb5f5e418bfc197e7533b5e3065e3 (patch) | |
tree | bebd21ce8f2f02c3b2b62b6fe779828557484047 /lisp/mastodon-http.el | |
parent | 5123212fa191ce5215262367d1022fd1441dc19a (diff) | |
parent | 27783caa940af9120ef21d005dcdd1861fc8710e (diff) |
Merge branch 'develop'
Diffstat (limited to 'lisp/mastodon-http.el')
-rw-r--r-- | lisp/mastodon-http.el | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 551d4fd..663e2a9 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -309,7 +309,7 @@ PARAMS is an alist of any extra parameters to send with the request." Then run function CALLBACK with arguements CBARGS. Authorization header is included by default unless UNAUTHENTICED-P is non-nil." (mastodon-http--authorized-request "POST" - (let ((request-timeout 5) + (let (;(request-timeout 5) ; this is from request.el no url.el! (url-request-data (when params (mastodon-http--build-params-string params)))) (with-temp-buffer @@ -322,7 +322,15 @@ The upload is asynchronous. On succeeding, `mastodon-toot--media-attachment-ids' is set to the id(s) of the item uploaded, and `mastodon-toot--update-status-fields' is run." (let* ((file (file-name-nondirectory filename)) - (request-backend 'curl)) + (request-backend 'curl) + (cb (cl-function + (lambda (&key data &allow-other-keys) + (when data + (push (alist-get 'id data) + mastodon-toot--media-attachment-ids) ; add ID to list + (message (alist-get 'id data)) + (message "Uploading %s... (done)" file) + (mastodon-toot--update-status-fields)))))) (request url :type "POST" @@ -333,13 +341,7 @@ item uploaded, and `mastodon-toot--update-status-fields' is run." :headers `(("Authorization" . ,(concat "Bearer " (mastodon-auth--access-token)))) :sync nil - :success (cl-function - (lambda (&key data &allow-other-keys) - (when data - (push (alist-get 'id data) - mastodon-toot--media-attachment-ids) ; add ID to list - (message "Uploading %s... (done)" file) - (mastodon-toot--update-status-fields)))) + :success (apply-partially cb) :error (cl-function (lambda (&key error-thrown &allow-other-keys) (cond |