aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authoralexjgriffith <griffitaj@gmail.com>2017-05-01 15:01:31 -0400
committerJohnson Denen <johnson.denen@gmail.com>2017-05-05 11:41:18 -0400
commitc99625f5b6df932afe75b1f7535509592e639442 (patch)
treeb748a98ef4d7495a891e8e225f3621eb09f9d80f /lisp
parent54f04edafb24ef45206031c0cecf62f235eecc07 (diff)
Added suport for multiple media display per toot
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-tl.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 7ea38c4..befea1f 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -57,8 +57,8 @@
"Prompts for tag and opens its timeline."
(interactive)
(let* ((word (or (word-at-point) ""))
- (input (read-string (format "Tag(%s): " word)))
- (tag (if (equal input "") word input)))
+ (input (read-string (format "Tag(%s): " word)))
+ (tag (if (equal input "") word input)))
(print tag)
(mastodon-tl--get (concat "tag/" tag))))
@@ -177,16 +177,19 @@ also render the html"
"\n ---------------" (concat string cw))
"")))
-
(defun mastodon-tl--media (toot)
- "Retreive a media attachment link if one exists."
+ "Retreive a media attachment link for TOOT if one exists."
(let ((media (mastodon-tl--field 'media_attachments toot)))
(if (> (length media) 0 )
;; Extract the preview_url, other options here
;; are url and remote_url
- (let ((link (cdr(assoc 'preview_url (elt media 0)))))
- (concat "Media_Link:: "
- (mastodon-tl--set-face link 'mouse-face 'nil)))
+ (mapconcat
+ (lambda (image)
+ (concat "Media_Link:: "
+ (mastodon-tl--set-face
+ (cdr (assoc 'preview_url image))
+ 'mouse-face 'nil)))
+ media "\n")
;; Otherwise return an empty string
"")))