aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
authorAlexander Griffith <griffitaj@gmail.com>2017-05-12 19:19:14 -0400
committerGitHub <noreply@github.com>2017-05-12 19:19:13 -0400
commit8cd83d70daa94c5387764c059419c518623099d8 (patch)
treec85cc7b036b4fb4e59b98f540c1b57a38eb9b6f5 /lisp/mastodon-tl.el
parent4d0bd43c0ede0159c0f0130a5565ea5a6511997a (diff)
parent91d488571bf796b61d275def376603975f127fde (diff)
Merge pull request #121 from hdurer/async-image-loading
Async image loading and avatars
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index e025a6e..b3550c6 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,12 @@ 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)))
- (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)))
+ (mapconcat
+ (lambda (media-attachement)
+ (let ((preview-url (cdr (assoc 'preview_url media-attachement))))
+ (mastodon-media--get-media-link-rendering preview-url)))
+ media-attachements "")))
(defun mastodon-tl--content (toot)
"Retrieve text content from TOOT."