emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ement 2349b91eb3 1/4: Fix room list display with empty


From: ELPA Syncer
Subject: [elpa] externals/ement 2349b91eb3 1/4: Fix room list display with empty notification actions
Date: Mon, 14 Aug 2023 00:57:52 -0400 (EDT)

branch: externals/ement
commit 2349b91eb3106f9a550940471b982802ebc05ed9
Author: Steven Allen <steven@stebalien.com>
Commit: Adam Porter <adam@alphapapa.net>

    Fix room list display with empty notification actions
    
    Parse actions according to
    https://spec.matrix.org/v1.7/client-server-api/#actions, allowing for 0
    or more actions in any order.
    
    fixes #181
---
 ement-lib.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/ement-lib.el b/ement-lib.el
index 985523d1de..0138101381 100644
--- a/ement-lib.el
+++ b/ement-lib.el
@@ -597,12 +597,12 @@ Returns one of nil (meaning default rules are used), 
`all-loud',
                                          (equal "room_id" key)
                                          (equal (ement-room-id room) 
pattern)))))
                 (mute-rule-p
-                 (rule) (and (= 1 (length (alist-get 'actions rule)))
-                             (equal "dont_notify" (elt (alist-get 'actions 
rule) 0))))
+                 (rule) (when-let ((actions (alist-get 'actions rule)))
+                          (seq-contains-p actions "dont_notify")))
                 (tweak-rule-p
-                 (type rule) (pcase-let (((map ('actions `[,action ,alist])) 
rule))
-                               (and (equal "notify" action)
-                                    (equal type (alist-get 'set_tweak 
alist))))))
+                 (type rule) (when-let ((actions (alist-get 'actions rule)))
+                               (and (seq-contains-p actions "notify")
+                                    (seq-contains-p actions `(set_tweak . 
,type) 'seq-contains-p)))))
       ;; If none of these match, nil is returned, meaning that the default 
rule is used
       ;; for the room.
       (if (override-mute-rule-for-room-p room)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]