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:28:24 +0200
commit45b3843f38e1052b088e33ba8fe1fc0a5faef0d2 (patch)
tree8a8b86efd2bcd693ce6b696d438bf8eb85f77558 /lisp/mastodon-media.el
parent83cfe439a4e66f0ccb79d46db35948275329db28 (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)