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.el32
1 files changed, 29 insertions, 3 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index fbebd69..9305bea 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -951,12 +951,38 @@ webapp"
(alist-get 'descendants context)))))
(message "No Thread!"))))
-(defun mastodon-tl--follow-user (user-handle)
- "Query for USER-HANDLE from current status and follow that user."
+(defun mastodon-tl--follow-user (user-handle &optional notify)
+ "Query for USER-HANDLE from current status and follow that user.
+If NOTIFY is \"true\", enable notifications when that user posts.
+If NOTIFY is \"false\", disable notifications when that user posts."
(interactive
(list
(mastodon-tl--interactive-user-handles-get "follow")))
- (mastodon-tl--do-user-action-and-response user-handle "follow"))
+ (mastodon-tl--do-user-action-and-response user-handle "follow" notify))
+
+(defun mastodon-tl--notify-user-posts (user-handle)
+ "Query for USER-HANDLE from current status and enable notifications when they post."
+ (interactive
+ (list
+ (let ((user-handles (mastodon-profile--extract-users-handles
+ (mastodon-profile--toot-json))))
+ (completing-read "Receive notifications when user posts: "
+ user-handles
+ nil ; predicate
+ 'confirm))))
+ (mastodon-tl--follow-user user-handle "true"))
+
+(defun mastodon-tl--no-notify-user-posts (user-handle)
+ "Query for USER-HANDLE from current status and disable notifications when they post."
+ (interactive
+ (list
+ (let ((user-handles (mastodon-profile--extract-users-handles
+ (mastodon-profile--toot-json))))
+ (completing-read "Disable notifications when user posts: "
+ user-handles
+ nil ; predicate
+ 'confirm))))
+ (mastodon-tl--follow-user user-handle "false"))
(defun mastodon-tl--unfollow-user (user-handle)
"Query for USER-HANDLE from current status and unfollow that user."