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

@ -8,9 +8,6 @@
- profiles missing in notifications - profiles missing in notifications
- option to use plaintext notifications - option to use plaintext notifications
- Notification urgency level (plyer)? - Notification urgency level (plyer)?
- Make local unread counter an optional turned off by default
- Implement fallback QML notifications, usable if dbus isn't available
- annoying tooltips when menu open - annoying tooltips when menu open
- add http_proxy support - add http_proxy support

View File

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

View File

@ -74,9 +74,14 @@ class RoomList:
min_width: int = 144 min_width: int = 144
# Sort rooms in alphabetical order instead of recent activity. # 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 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. # When clicking on a room, recenter the room list on that room.
click_centers: bool = False click_centers: bool = False

View File

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