Make local unread markers optional, off by default

Add RoomList.local_unread_markers option to settings.py,
which is False by default.
Before, this way always enabled and conflicts with push rules by marking
anything as unread without any logic.
This commit is contained in:
miruka
2021-01-21 11:16:03 -04:00
parent 4f4bc90faa
commit a06ce3352e
4 changed files with 11 additions and 7 deletions

View File

@@ -2246,8 +2246,10 @@ class MatrixClient(nio.AsyncClient):
await self.update_account_unread_counts()
return item
self.models[self.user_id, "rooms"][room.room_id].local_unreads = True
await self.update_account_unread_counts()
if self.backend.settings.RoomList.local_unread_markers:
room_item = self.models[self.user_id, "rooms"][room.room_id]
room_item.local_unreads = True
await self.update_account_unread_counts()
# Alerts & notifications

View File

@@ -74,9 +74,14 @@ class RoomList:
min_width: int = 144
# Sort rooms in alphabetical order instead of recent activity.
# The application must be restarted to apply changes to this setting.
# The application must be restarted to apply changes for this setting.
lexical_sort: bool = False
# When any event is received in a room, mark the room as unread with a [!],
# regardless of notification push rules. This does not take into account
# anything received while the client is not running.
local_unread_markers: bool = False
# When clicking on a room, recenter the room list on that room.
click_centers: bool = False

View File

@@ -66,7 +66,7 @@ HTile {
(model.bookmarked ? "\u2665 " : "") +
(model.display_name || qsTr("Empty room"))
color:
model.local_unreads ?
model.unreads || model.local_unreads ?
theme.mainPane.listView.room.unreadName :
theme.mainPane.listView.room.name
}