branch: externals/ement commit 1e348a793c9865bbb66fd5a8fbb5124bfa91d515 Author: Adam Porter <a...@alphapapa.net> Commit: Adam Porter <a...@alphapapa.net>
Comment: Add I suppose I'll leave this as-is until the official SDK is updated to match its spec, because the intention is to mostly imitate Element's behavior. See <https://spec.matrix.org/v1.7/client-server-api/#actions> and <https://github.com/matrix-org/matrix-react-sdk/blob/4a9c4198b0801c3bb427892a063a3f8590f48f08/src/RoomNotifs.ts#L220-L225>. See also #190. --- ement-lib.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ement-lib.el b/ement-lib.el index a0edf9db9a..51f9fd59c5 100644 --- a/ement-lib.el +++ b/ement-lib.el @@ -600,6 +600,9 @@ Returns one of nil (meaning default rules are used), `all-loud', (mute-rule-p (rule) (when-let ((actions (alist-get 'actions rule))) (seq-contains-p actions "dont_notify"))) + ;; NOTE: Although v1.7 of the spec says that "dont_notify" is + ;; obsolete, the latest revision of matrix-react-sdk (released last week + ;; as v3.77.1) still works as modeled here. (tweak-rule-p (type rule) (when-let ((actions (alist-get 'actions rule))) (and (seq-contains-p actions "notify") @@ -618,7 +621,7 @@ Returns one of nil (meaning default rules are used), `all-loud', 'all) ((mute-rule-p room-rule) ;; According to comment, a room-level mute still allows mentions to - ;; notify. + ;; notify. NOTE: See note above. 'mentions-and-keywords) ((tweak-rule-p "sound" room-rule) 'all-loud)))))))