diff options
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r-- | lisp/mastodon-tl.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 7e9eb60..b2b8026 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -987,7 +987,7 @@ webapp" "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. -This can be called to toggle NOTIFY on users already being followed." +Can be called to toggle NOTIFY on users already being followed." (interactive (list (mastodon-tl--interactive-user-handles-get "follow"))) @@ -1077,15 +1077,16 @@ Action must be either \"unblock\" or \"mute\"." t)))) (defun mastodon-tl--do-user-action-and-response (user-handle action &optional negp notify) - "Do ACTION on user NAME/USER-HANDLE. + "Do ACTION on user USER-HANDLE. NEGP is whether the action involves un-doing something. If NOTIFY is \"true\", enable notifications when that user posts. If NOTIFY is \"false\", disable notifications when that user posts. NOTIFY is only non-nil when called by `mastodon-tl--follow-user'." (let* ((account (if negp - ;; TODO check if both are actually needed + ;; if unmuting/unblocking, we got handle from mute/block list (mastodon-profile--search-account-by-handle user-handle) + ;; if muting/blocking, we select from handles in current status (mastodon-profile--lookup-account-in-status user-handle (mastodon-profile--toot-json)))) (user-id (mastodon-profile--account-field account 'id)) @@ -1102,7 +1103,9 @@ NOTIFY is only non-nil when called by `mastodon-tl--follow-user'." (message "Cannot find a user with handle %S" user-handle)))) (defun mastodon-tl--do-user-action-function (url name user-handle action &optional notify) - "Post ACTION on user NAME/USER-HANDLE to URL." + "Post ACTION on user NAME/USER-HANDLE to URL. +NOTIFY is either \"true\" or \"false\", and used when we have been called +by `mastodon-tl--follow-user' to enable or disable notifications." (let ((response (mastodon-http--post url nil nil))) (mastodon-http--triage response (lambda () @@ -1112,6 +1115,8 @@ NOTIFY is only non-nil when called by `mastodon-tl--follow-user'." ((string-equal notify "false") (message "Not receiving notifications for user %s (@%s)!" name user-handle)) + ((string-equal action "mute") + (message "User %s (@%s) %sd!" name user-handle action)) ((eq notify nil) (message "User %s (@%s) %sed!" name user-handle action))))))) |