aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-http.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-02-01 15:58:07 +0100
committermarty hiatt <martianhiatus@riseup.net>2024-02-01 15:58:07 +0100
commit136e4d387a99ea5a1eb5cd1eee85d927b04203d1 (patch)
treebc1634665af09e819fbf5a10f749eb345227b9b2 /lisp/mastodon-http.el
parenta8c80d25b7790746a439ae6c2deea3dc6bcac710 (diff)
parentfda3e5963d803754fc2e4d0bdbc005ab5e47a93d (diff)
Merge branch 'develop'
Diffstat (limited to 'lisp/mastodon-http.el')
-rw-r--r--lisp/mastodon-http.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el
index 1edc8b5..a357672 100644
--- a/lisp/mastodon-http.el
+++ b/lisp/mastodon-http.el
@@ -5,7 +5,6 @@
;; Author: Johnson Denen <johnson.denen@gmail.com>
;; Marty Hiatt <martianhiatus@riseup.net>
;; Maintainer: Marty Hiatt <martianhiatus@riseup.net>
-;; Version: 1.0.0
;; Homepage: https://codeberg.org/martianh/mastodon.el
;; This file is not part of GNU Emacs.
@@ -98,10 +97,14 @@ RESPONSE if unsuccessful."
(mastodon-http--process-json))))
(message "Error %s: %s" status (alist-get 'error json-response)))))))
-(defun mastodon-http--read-file-as-string (filename)
- "Read a file FILENAME as a string. Used to generate image preview."
+(defun mastodon-http--read-file-as-string (filename &optional url)
+ "Read a file FILENAME as a string.
+Used to generate image preview.
+URL means FILENAME is a URL."
(with-temp-buffer
- (insert-file-contents filename)
+ (if url
+ (url-insert-file-contents filename)
+ (insert-file-contents filename))
(string-to-unibyte (buffer-string))))
(defmacro mastodon-http--authorized-request (method body &optional unauthenticated-p)