diff options
author | marty hiatt <martianhiatus@riseup.net> | 2023-10-24 14:10:43 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus@riseup.net> | 2023-10-24 14:10:43 +0200 |
commit | f1bc8d83d4a5fe324821ee890bf9dca6f05c6596 (patch) | |
tree | 81a7ae4e3fb8608ef64385d59f1436525612f0dd /lisp | |
parent | 826c228d096a886ec2e451cc5d2251bcf356d846 (diff) |
display replies policy & exclusive status for lists
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-views.el | 71 |
1 files changed, 37 insertions, 34 deletions
diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el index d7d8e7e..6dfb8a2 100644 --- a/lisp/mastodon-views.el +++ b/lisp/mastodon-views.el @@ -207,41 +207,44 @@ provides the JSON data." (defun mastodon-views--print-list-set (lists) "Print each account plus a separator for each list in LISTS." - (let ((lists-names (mastodon-tl--map-alist 'title lists))) - (mapc (lambda (x) - (mastodon-views--print-list-accounts x) - (insert (propertize (concat " " mastodon-tl--horiz-bar "\n\n") - 'face 'success))) - lists-names))) - -(defun mastodon-views--print-list-accounts (list-name) - "Insert the accounts in list named LIST-NAME." - (let* ((id (mastodon-views--get-list-id list-name)) - (accounts (mastodon-views--accounts-in-list id))) - (insert - (propertize list-name - 'byline t ; so we nav here - 'item-id "0" ; so we nav here - 'item-type 'user - 'help-echo "RET: view list timeline, d: delete this list, \ + (mapc (lambda (x) + (mastodon-views--print-list-accounts x) + (insert (propertize (concat " " mastodon-tl--horiz-bar "\n\n") + 'face 'success))) + lists)) + +(defun mastodon-views--print-list-accounts (list) + "Insert the accounts in list named LIST, an alist." + (let-alist list + (let* ((accounts (mastodon-views--accounts-in-list .id))) + (insert + (propertize .title + 'byline t ; so we nav here + 'item-id "0" ; so we nav here + 'item-type 'user + 'help-echo "RET: view list timeline, d: delete this list, \ a: add account to this list, r: remove account from this list" - 'list t - 'face 'link - 'keymap mastodon-views--list-name-keymap - 'list-name list-name - 'list-id id) - (propertize "\n\n" - 'list t - 'keymap mastodon-views--list-name-keymap - 'list-name list-name - 'list-id id) - (propertize - (mapconcat #'mastodon-search--propertize-user accounts - " ") - 'list t - 'keymap mastodon-views--list-name-keymap - 'list-name list-name - 'list-id id)))) + 'list t + 'face 'link + 'keymap mastodon-views--list-name-keymap + 'list-name .title + 'list-id .id) + (propertize (format " [replies: %s, exclusive %s]" + .replies_policy + (when (eq t .exclusive) "true")) + 'face 'font-lock-comment-face) + (propertize "\n\n" + 'list t + 'keymap mastodon-views--list-name-keymap + 'list-name .title + 'list-id .id) + (propertize + (mapconcat #'mastodon-search--propertize-user accounts + " ") + 'list t + 'keymap mastodon-views--list-name-keymap + 'list-name .title + 'list-id .id))))) (defun mastodon-views--get-users-lists () "Get the list of the user's lists from the server." |