diff options
author | mousebot <mousebot@riseup.net> | 2021-05-16 13:05:26 +0200 |
---|---|---|
committer | mousebot <mousebot@riseup.net> | 2021-05-16 13:18:19 +0200 |
commit | e1269b9fbf87013a9909cfced340fa47f43dc33a (patch) | |
tree | a702894fb21469b49bf5f56f7296e5e317740f3f /lisp/mastodon-tl.el | |
parent | 508e3faeceb03ad14bb350d0da56552edf33ccc2 (diff) |
display pinned toots first on a user's profile.
also: profile--relationships-get no longer interactive.
and docstrings for fields insert.
indent "pinned" for pinned toots display
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r-- | lisp/mastodon-tl.el | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 7624088..8ac9d9c 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -673,9 +673,23 @@ it is `mastodon-tl--byline-boosted'" 'mastodon-tl--byline-boosted)) (defun mastodon-tl--timeline (toots) - "Display each toot in TOOTS." - (mapc 'mastodon-tl--toot toots) - (goto-char (point-min))) + "Display each toot in TOOTS. + +If any toots are pinned, display them first." + (let* ((pinned-list)) + (mapcar (lambda (toot) + (when (equal (cdr (assoc 'pinned toot)) 't) + (push toot pinned-list))) + toots) + (when pinned-list + (progn + (insert (mastodon-tl--set-face + " :pinned: " 'success)) + (mapc 'mastodon-tl--toot pinned-list) + (insert (mastodon-tl--set-face + " :end-pinned: \n" 'success)))) + (mapc 'mastodon-tl--toot toots) + (goto-char (point-min)))) (defun mastodon-tl--get-update-function (&optional buffer) "Get the UPDATE-FUNCTION stored in `mastodon-tl--buffer-spec'" |