aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-media.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-08-17 10:28:24 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-08-17 10:29:15 +0200
commitaa9b4a7dd180bd27bc7ebb43bd2ca58c9b01de7f (patch)
tree2148cb541c2a8fc36e0a4af3794f024cd5aaa366 /lisp/mastodon-media.el
parent1adb3e8583f8ec851cb2420c8cfede1192d017b7 (diff)
image-or-cached, apply not funcall. FIX #577.
Diffstat (limited to 'lisp/mastodon-media.el')
-rw-r--r--lisp/mastodon-media.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el
index ce2f8f5..620aa51 100644
--- a/lisp/mastodon-media.el
+++ b/lisp/mastodon-media.el
@@ -359,7 +359,8 @@ STATUS-PLIST is a plist of status events as per `url-retrieve'."
(defun mastodon-media--image-or-cached (url process-fun args)
"Fetch URL from cache or fro host.
-Call PROCESS-FUN on it with ARGS."
+Call PROCESS-FUN on it with ARGS, a list of callback args as
+specified by `url-retrieve'."
(if (and mastodon-media--enable-image-caching
(url-is-cached url)) ;; if cached, decompress and use:
(with-current-buffer (url-fetch-from-cache url)
@@ -367,8 +368,9 @@ Call PROCESS-FUN on it with ARGS."
(goto-char (point-min))
(zlib-decompress-region
(goto-char (search-forward "\n\n")) (point-max))
- (funcall process-fun url args))
- ;; fetch as usual and process-image-response will cache it
+ (apply process-fun args)) ;; no status-plist arg from cache
+ ;; fetch as usual and process-image-response will cache it:
+ ;; cbargs fun will be called with status-plist by url-retrieve:
(url-retrieve url process-fun (cdr args))))
(defun mastodon-media--load-image-from-url (url media-type start region-length)