aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el34
1 files changed, 23 insertions, 11 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index e4f2dc9..46ec8fe 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -61,7 +61,7 @@
(autoload 'mastodon-profile--lookup-account-in-status "mastodon-profile")
(autoload 'mastodon-profile-mode "mastodon-profile")
;; make notifications--get available via M-x and outside our keymap:
-(autoload 'mastodon-notifications--get "mastodon-notifications"
+(autoload 'mastodon-notifications-get "mastodon-notifications"
"Display NOTIFICATIONS in buffer." t) ; interactive
(autoload 'mastodon-search--propertize-user "mastodon-search")
(autoload 'mastodon-search--insert-users-propertized "mastodon-search")
@@ -619,7 +619,8 @@ this just means displaying toot client."
(concat (when boosted
(mastodon-tl--format-faved-or-boosted-byline "B"))
(when faved
- (mastodon-tl--format-faved-or-boosted-byline "F"))
+ (mastodon-tl--format-faved-or-boosted-byline
+ (mastodon-tl--return-fave-char)))
(when bookmarked
(mastodon-tl--format-faved-or-boosted-byline bookmark-str)))
;; we remove avatars from the byline also, so that they also do not mess
@@ -693,6 +694,16 @@ this just means displaying toot client."
(mastodon-toot--get-toot-edits (alist-get 'id toot)))
'byline t))))
+(defun mastodon-tl--return-fave-char ()
+ ""
+ (cond
+ ((fontp (char-displayable-p #10r11088))
+ "⭐")
+ ((fontp (char-displayable-p #10r9733))
+ "★")
+ (t
+ "F")))
+
(defun mastodon-tl--format-edit-timestamp (timestamp)
"Convert edit TIMESTAMP into a descriptive string."
(let ((parsed (ts-human-duration
@@ -1481,7 +1492,7 @@ If ID is provided, use that list."
(interactive)
(let* ((list-names (unless id (mastodon-tl--get-lists-names)))
(name-old (if id
- (get-text-property (point) 'list-id)
+ (get-text-property (point) 'list-name)
(completing-read "Edit list: "
list-names)))
(id (or id (mastodon-tl--get-list-id name-old)))
@@ -1631,12 +1642,13 @@ a: add account to this list, r: remove account from this list"
(let ((id (get-text-property (point) 'list-id)))
(mastodon-tl--add-account-to-list id)))
-(defun mastodon-tl--add-account-to-list (&optional id)
+(defun mastodon-tl--add-account-to-list (&optional id account-id handle)
"Prompt for a list and for an account, add account to list.
-If ID is provided, use that list."
+If ID is provided, use that list.
+If ACCOUNT-ID and HANDLE are provided use them rather than prompting."
(interactive)
(let* ((list-name (if id
- (get-text-property (point) 'list-id)
+ (get-text-property (point) 'list-name)
(completing-read "Add account to list: "
(mastodon-tl--get-lists-names) nil t)))
(list-id (or id (mastodon-tl--get-list-id list-name)))
@@ -1645,9 +1657,9 @@ If ID is provided, use that list."
(cons (alist-get 'acct x)
(alist-get 'id x)))
followings))
- (account (completing-read "Account to add: "
- handles nil t))
- (account-id (alist-get account handles nil nil 'equal))
+ (account (or handle (completing-read "Account to add: "
+ handles nil t)))
+ (account-id (or account-id (alist-get account handles nil nil 'equal)))
(url (mastodon-http--api (format "lists/%s/accounts" list-id)))
(response (mastodon-http--post url
`(("account_ids[]" . ,account-id)))))
@@ -1666,7 +1678,7 @@ If ID is provided, use that list."
If ID is provided, use that list."
(interactive)
(let* ((list-name (if id
- (get-text-property (point) 'list-id)
+ (get-text-property (point) 'list-name)
(completing-read "Remove account from list: "
(mastodon-tl--get-lists-names) nil t)))
(list-id (or id (mastodon-tl--get-list-id list-name)))
@@ -2234,7 +2246,7 @@ For use after e.g. deleting a toot."
((equal (mastodon-tl--get-endpoint) "timelines/public?local=true")
(mastodon-tl--get-local-timeline))
((equal (mastodon-tl--get-endpoint) "notifications")
- (mastodon-notifications--get))
+ (mastodon-notifications-get))
((equal (mastodon-tl--buffer-name)
(concat "*mastodon-" (mastodon-auth--get-account-name) "-statuses*"))
(mastodon-profile--my-profile))