diff options
author | Alexander Griffith <griffitaj@gmail.com> | 2017-04-24 11:11:00 -0400 |
---|---|---|
committer | Johnson Denen <johnson.denen@gmail.com> | 2017-04-24 23:18:59 -0400 |
commit | 6cd700b2c73f1302abd7ac65504a78250985f8a7 (patch) | |
tree | a03a8d8de946850bad287ae7fe77b20b7855a328 /lisp/mastodon-media.el | |
parent | 22dc9b27bf5251bd8acdb14ddb58186bffabea98 (diff) |
Now using mastodon-http--get
Diffstat (limited to 'lisp/mastodon-media.el')
-rw-r--r-- | lisp/mastodon-media.el | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index b030280..6a4b177 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -26,17 +26,18 @@ ;; mastodon-media.el provides functions for inlining media. ;;; Code: +(require 'mastodon-http) (defun mastodon-media--image-from-url (url) "Takes a url and returns an image" - (let ((buffer (url-retrieve-synchronously url))) + (let ((buffer (mastodon-http--get url))) (unwind-protect - (let ((data (with-current-buffer buffer - (goto-char (point-min)) - (search-forward "\n\n") - (buffer-substring (point) (point-max))))) + (let ((data (with-current-buffer buffer + (goto-char (point-min)) + (search-forward "\n\n") + (buffer-substring (point) (point-max))))) (insert "\n") - (insert-image (create-image data nil t))) + (insert-image (create-image data nil t))) (kill-buffer buffer)))) (defun mastodon-media--select-media-line(start) @@ -53,12 +54,11 @@ contains `Media_Links::'" (mastodon-media--select-media-line 1)) (defun mastodon-media--check-missing(link) - "Checks to make sure that the missing string has + "Checks to make sure that the missing string has not been returned." (let((missing "/files/small/missing.png")) - (not(equal link missing))) - t) + (not(equal link missing)))) (defun mastodon-media--select-next-media-line() (mastodon-media--select-media-line '())) |