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

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

[elpa] externals/ement e6520c794e 2/3: Add: (ement-room-unread-only-coun


From: ELPA Syncer
Subject: [elpa] externals/ement e6520c794e 2/3: Add: (ement-room-unread-only-counts-notifications)
Date: Wed, 5 Oct 2022 17:57:36 -0400 (EDT)

branch: externals/ement
commit e6520c794e6b4a85d9710750a58d664954c42651
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>

    Add: (ement-room-unread-only-counts-notifications)
---
 README.org    | 3 ++-
 ement-lib.el  | 4 +++-
 ement-room.el | 8 ++++++++
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/README.org b/README.org
index 60b2448c5e..d7ea60de94 100644
--- a/README.org
+++ b/README.org
@@ -288,7 +288,8 @@ Note that, while ~matrix-client~ remains usable, and 
probably will for some time
 
 ** 0.4-pre
 
-Nothing new yet.
+*Additions*
++ Option ~ement-room-unread-only-counts-notifications~, now enabled by 
default, causes rooms' unread status to be determined only by their 
notification counts (which are set by the server and depend on rooms' 
notification settings).
 
 ** 0.3.1
 
diff --git a/ement-lib.el b/ement-lib.el
index 4c4669cbc3..c0fae8bb93 100644
--- a/ement-lib.el
+++ b/ement-lib.el
@@ -60,6 +60,7 @@
 (defvar ement-room-prism)
 (defvar ement-room-prism-color-adjustment)
 (defvar ement-room-prism-minimum-contrast)
+(defvar ement-room-unread-only-counts-notifications)
 
 ;;;; Compatibility
 
@@ -1139,7 +1140,8 @@ is not at the latest known message event."
                  (not (zerop highlight_count))))
         ;; NOTE: This is *WAY* too complicated, but it seems roughly 
equivalent to doesRoomHaveUnreadMessages() from
         ;; 
<https://github.com/matrix-org/matrix-react-sdk/blob/7fa01ffb068f014506041bce5f02df4f17305f02/src/Unread.ts#L52>.
-        (when timeline
+        (when (and (not ement-room-unread-only-counts-notifications)
+                   timeline)
           ;; A room should rarely, if ever, have a nil timeline, but in case 
it does
           ;; (which apparently can happen, given user reports), it should not 
be
           ;; considered unread.
diff --git a/ement-room.el b/ement-room.el
index 1aae3ab3ff..3d1154d0f5 100644
--- a/ement-room.el
+++ b/ement-room.el
@@ -352,6 +352,14 @@ Automatically set by setting 
`ement-room-message-format-spec',
 but may be overridden manually."
   :type 'boolean)
 
+(defcustom ement-room-unread-only-counts-notifications t
+  "Only use notification counts to mark rooms unread.
+Notification counts are set by the server based on each room's
+notification settings.  Otherwise, whether a room is marked
+unread depends on the room's fully-read marker, read-receipt
+marker, whether the local user sent the latest events, etc."
+  :type 'boolean)
+
 (defvar ement-room-sender-in-left-margin nil
   "Whether sender is shown in left margin.
 Set by `ement-room-message-format-spec-setter'.")



reply via email to

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