aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
authorAlexander Griffith <griffitaj@gmail.com>2017-05-12 22:53:51 -0400
committerAlexander Griffith <griffitaj@gmail.com>2017-05-12 22:53:51 -0400
commitb0ead06b42ed06218e87a0bb75dae41570592423 (patch)
treebf75546562e652aef18c6e7a72fc13f3cfc04d99 /lisp/mastodon-tl.el
parentd154f9fa762a258601015b44895eed5cbbdc7d78 (diff)
Adjusted for async image changes
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el23
1 files changed, 13 insertions, 10 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 12b739b..7efaf11 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -104,8 +104,11 @@ Optionally start from POS."
"Propertize author of TOOT."
(let* ((account (cdr (assoc 'account toot)))
(handle (cdr (assoc 'acct account)))
- (name (cdr (assoc 'display_name account))))
+ (name (cdr (assoc 'display_name account)))
+ (avatar-url (cdr (assoc 'avatar account))))
(concat
+ (when mastodon-media-show-avatars-p
+ (mastodon-media--get-avatar-rendering avatar-url))
(propertize name 'face 'warning)
" (@"
handle
@@ -177,14 +180,14 @@ also render the html"
(defun mastodon-tl--media (toot)
"Retrieve a media attachment link for TOOT if one exists."
- (let* ((media (mastodon-tl--field 'media_attachments toot))
- (media-string (mapconcat
- (lambda (media-preview)
- (concat "Media_Link:: "
- (mastodon-tl--set-face
- (cdr (assoc 'preview_url media-preview))
- 'mouse-face nil)))
- media "\n")))
+ (let* ((media-attachements (mastodon-tl--field 'media_attachments toot))
+ (media-string
+ (mapconcat
+ (lambda (media-attachement)
+ (let ((preview-url
+ (cdr (assoc 'preview_url media-attachement))))
+ (mastodon-media--get-media-link-rendering preview-url)))
+ media-attachements "")))
(if (not (equal media-string ""))
(concat "\n" media-string ) "")))
@@ -203,7 +206,7 @@ also render the html"
(insert
(concat
(mastodon-tl--spoiler toot)
- (replace-regexp-in-string "\n*$" "" (mastodon-tl--content toot))
+ (replace-regexp-in-string "\n*$" "" (mastodon-tl--content toot))
(mastodon-tl--media toot)
"\n\n"
(mastodon-tl--byline toot)