aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-10-10 19:57:48 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-10-10 19:57:48 +0200
commit7ed54ce921e357d2b7d655921b694a5599cd9be0 (patch)
tree455471f96d7c0619e3558aff88a32468bca6d867 /lisp
parent119bca6c441ef5fbed95ed8000a76ec8f7612796 (diff)
clean up cond predicates - use member!
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-notifications.el43
1 files changed, 18 insertions, 25 deletions
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el
index db8b842..2091118 100644
--- a/lisp/mastodon-notifications.el
+++ b/lisp/mastodon-notifications.el
@@ -240,18 +240,15 @@ Status notifications are given when
nil
(mastodon-tl--insert-status
;; toot
- (cond ((or (eq type 'follow)
- (eq type 'follow-request))
+ (cond ((member type '(follow follow-request))
;; Using reblog with an empty id will mark this as something
;; non-boostable/non-favable.
(cons '(reblog (id . nil)) note))
;; reblogs/faves use 'note' to process their own json
;; not the toot's. this ensures following etc. work on such notifs
- ((or (eq type 'favourite)
- (eq type 'reblog))
+ ((member type '(favourite reblog))
note)
- (t
- status))
+ (t status))
;; body
(let ((body (if-let ((match (assoc "warn" filters)))
(mastodon-tl--spoiler toot (cadr match))
@@ -261,28 +258,25 @@ Status notifications are given when
(if (eq 'follow-request type)
(mastodon-tl--render-text profile-note)
(mastodon-tl--content status)))))))
- (cond ((or (eq type 'follow)
- (eq type 'follow-request))
- (if (eq type 'follow)
- (propertize "Congratulations, you have a new follower!"
- 'face 'default)
- (concat
- (propertize
- (format "You have a follow request from... %s"
- follower)
- 'face 'default)
- (when mastodon-notifications--profile-note-in-foll-reqs
+ (cond ((eq type 'follow)
+ (propertize "Congratulations, you have a new follower!"
+ 'face 'default))
+ ((eq type 'follow-request)
+ (concat
+ (propertize
+ (format "You have a follow request from... %s"
+ follower)
+ 'face 'default)
+ (if mastodon-notifications--profile-note-in-foll-reqs
(concat
":\n"
- (mastodon-notifications--comment-note-text body))))))
- ((or (eq type 'favourite)
- (eq type 'reblog))
+ (mastodon-notifications--comment-note-text body))
+ "")))
+ ((member type '(favourite reblog))
(mastodon-notifications--comment-note-text body))
(t body)))
;; author-byline
- (if (or (eq type 'follow)
- (eq type 'follow-request)
- (eq type 'mention))
+ (if (member type '(follow follow-request mention))
'mastodon-tl--byline-author
(lambda (_status &rest _args) ; unbreak stuff
(mastodon-tl--byline-author note)))
@@ -292,8 +286,7 @@ Status notifications are given when
(alist-get type mastodon-notifications--action-alist)))
id
;; base toot
- (when (or (eq type 'favourite)
- (eq type 'reblog))
+ (when (member type '(favourite reblog))
status)))))
(defun mastodon-notifications--by-type (note)