aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-notifications.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon-notifications.el')
-rw-r--r--lisp/mastodon-notifications.el82
1 files changed, 41 insertions, 41 deletions
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el
index 36f9d4a..4437635 100644
--- a/lisp/mastodon-notifications.el
+++ b/lisp/mastodon-notifications.el
@@ -78,25 +78,25 @@
(interactive)
(when (mastodon-tl--find-property-range 'toot-json (point))
(let* ((toot-json (mastodon-tl--property 'toot-json))
- (f-req-p (string= "follow_request" (cdr (assoc 'type toot-json)))))
+ (f-req-p (string= "follow_request" (alist-get 'type toot-json))))
(if f-req-p
- (let* ((account (cdr (assoc 'account toot-json)))
- (id (cdr (assoc 'id account)))
- (handle (cdr (assoc 'acct account)))
- (name (cdr (assoc 'username account))))
- (if id
- (let ((response
- (mastodon-http--post
- (concat
- (mastodon-http--api "follow_requests")
- (format "/%s/authorize" id))
- nil nil)))
- (mastodon-http--triage response
- (lambda ()
- (mastodon-notifications--get)
- (message "Follow request of %s (@%s) accepted!"
- name handle))))
- (message "No account result at point?")))
+ (let* ((account (alist-get 'account toot-json))
+ (id (alist-get 'id account))
+ (handle (alist-get 'acct account))
+ (name (alist-get 'username account)))
+ (if id
+ (let ((response
+ (mastodon-http--post
+ (concat
+ (mastodon-http--api "follow_requests")
+ (format "/%s/authorize" id))
+ nil nil)))
+ (mastodon-http--triage response
+ (lambda ()
+ (mastodon-notifications--get)
+ (message "Follow request of %s (@%s) accepted!"
+ name handle))))
+ (message "No account result at point?")))
(message "No follow request at point?")))))
(defun mastodon-notifications--follow-request-reject-notifs ()
@@ -104,30 +104,30 @@
(interactive)
(when (mastodon-tl--find-property-range 'toot-json (point))
(let* ((toot-json (mastodon-tl--property 'toot-json))
- (f-req-p (string= "follow_request" (cdr (assoc 'type toot-json)))))
+ (f-req-p (string= "follow_request" (alist-get 'type toot-json))))
(if f-req-p
- (let* ((account (cdr (assoc 'account toot-json)))
- (id (cdr (assoc 'id account)))
- (handle (cdr (assoc 'acct account)))
- (name (cdr (assoc 'username account))))
- (if id
- (let ((response
- (mastodon-http--post
- (concat
- (mastodon-http--api "follow_requests")
- (format "/%s/reject" id))
- nil nil)))
- (mastodon-http--triage response
- (lambda ()
- (mastodon-notifications--get)
- (message "Follow request of %s (@%s) rejected!"
- name handle))))
- (message "No account result at point?")))
+ (let* ((account (alist-get 'account toot-json))
+ (id (alist-get 'id account))
+ (handle (alist-get 'acct account))
+ (name (alist-get 'username account)))
+ (if id
+ (let ((response
+ (mastodon-http--post
+ (concat
+ (mastodon-http--api "follow_requests")
+ (format "/%s/reject" id))
+ nil nil)))
+ (mastodon-http--triage response
+ (lambda ()
+ (mastodon-notifications--get)
+ (message "Follow request of %s (@%s) rejected!"
+ name handle))))
+ (message "No account result at point?")))
(message "No follow request at point?")))))
(defun mastodon-notifications--mention (note)
"Format for a `mention' NOTE."
- (let ((id (cdr (assoc 'id note)))
+ (let ((id (alist-get 'id note))
(status (mastodon-tl--field 'status note)))
(mastodon-notifications--insert-status
status
@@ -156,8 +156,8 @@
(defun mastodon-notifications--follow-request (note)
"Format for a `follow-request' NOTE."
- (let ((id (cdr (assoc 'id note)))
- (follower (cdr (assoc 'username (cdr (assoc 'account note))))))
+ (let ((id (alist-get 'id note))
+ (follower (alist-get 'username (alist-get 'account note))))
(mastodon-notifications--insert-status
(cons '(reblog (id . nil)) note)
(propertize (format "You have a follow request from... %s" follower)
@@ -170,7 +170,7 @@
(defun mastodon-notifications--favourite (note)
"Format for a `favourite' NOTE."
- (let ((id (cdr (assoc 'id note)))
+ (let ((id (alist-get 'id note))
(status (mastodon-tl--field 'status note)))
(mastodon-notifications--insert-status
status
@@ -188,7 +188,7 @@
(defun mastodon-notifications--reblog (note)
"Format for a `boost' NOTE."
- (let ((id (cdr (assoc 'id note)))
+ (let ((id (alist-get 'id note))
(status (mastodon-tl--field 'status note)))
(mastodon-notifications--insert-status
status