From 45b3843f38e1052b088e33ba8fe1fc0a5faef0d2 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 17 Aug 2024 10:28:24 +0200 Subject: image-or-cached, apply not funcall. FIX #577. --- lisp/mastodon-media.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lisp/mastodon-media.el') 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) -- cgit v1.2.3