From 6cd700b2c73f1302abd7ac65504a78250985f8a7 Mon Sep 17 00:00:00 2001 From: Alexander Griffith Date: Mon, 24 Apr 2017 11:11:00 -0400 Subject: Now using mastodon-http--get --- lisp/mastodon-media.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lisp/mastodon-media.el') 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 '())) -- cgit v1.2.3