Remove pointless local_highlights
An event can only be considered a highlight if a push rule make it so, thus an event can never be locally highlighted only.
This commit is contained in:
parent
35a8c0aec4
commit
2ef1edb3dc
|
@ -382,7 +382,6 @@ class Backend:
|
|||
unreads = 0,
|
||||
highlights = 0,
|
||||
local_unreads = False,
|
||||
local_highlights = False,
|
||||
)
|
||||
await client.update_account_unread_counts()
|
||||
|
||||
|
|
|
@ -1836,7 +1836,6 @@ class MatrixClient(nio.AsyncClient):
|
|||
unreads = 0
|
||||
highlights = 0
|
||||
local_unreads = False
|
||||
local_highlights = False
|
||||
|
||||
for room in self.models[self.user_id, "rooms"].values():
|
||||
unreads += room.unreads
|
||||
|
@ -1845,15 +1844,11 @@ class MatrixClient(nio.AsyncClient):
|
|||
if room.local_unreads:
|
||||
local_unreads = True
|
||||
|
||||
if room.local_highlights:
|
||||
local_highlights = True
|
||||
|
||||
account = self.models["accounts"][self.user_id]
|
||||
account.set_fields(
|
||||
total_unread = unreads,
|
||||
total_highlights = highlights,
|
||||
local_unreads = local_unreads,
|
||||
local_highlights = local_highlights,
|
||||
)
|
||||
|
||||
|
||||
|
@ -1903,7 +1898,6 @@ class MatrixClient(nio.AsyncClient):
|
|||
last_event_date = datetime.fromtimestamp(0)
|
||||
typing_members = []
|
||||
local_unreads = False
|
||||
local_highlights = False
|
||||
update_account_unread_counts = True
|
||||
unverified_devices = (
|
||||
False
|
||||
|
@ -1914,7 +1908,6 @@ class MatrixClient(nio.AsyncClient):
|
|||
last_event_date = registered.last_event_date
|
||||
typing_members = registered.typing_members
|
||||
local_unreads = registered.local_unreads
|
||||
local_highlights = registered.local_highlights
|
||||
update_account_unread_counts = (
|
||||
registered.unreads != room.unread_notifications or
|
||||
registered.highlights != room.unread_highlights
|
||||
|
@ -1965,7 +1958,6 @@ class MatrixClient(nio.AsyncClient):
|
|||
unreads = room.unread_notifications,
|
||||
highlights = room.unread_highlights,
|
||||
local_unreads = local_unreads,
|
||||
local_highlights = local_highlights,
|
||||
|
||||
lexical_sorting = self.backend.settings.RoomList.lexical_sort,
|
||||
bookmarked = room.room_id in bookmarks.get(self.user_id, []),
|
||||
|
@ -2272,9 +2264,6 @@ class MatrixClient(nio.AsyncClient):
|
|||
self.previous_server_unreads[room.room_id] = room_item.unreads
|
||||
self.previous_server_highlights[room.room_id] = room_item.highlights
|
||||
|
||||
if highlight:
|
||||
room_item.set_fields(local_unreads=True, local_highlights=True)
|
||||
else:
|
||||
room_item.local_unreads = True
|
||||
|
||||
if unread or highlight:
|
||||
|
|
|
@ -69,7 +69,6 @@ class Account(ModelItem):
|
|||
total_unread: int = 0
|
||||
total_highlights: int = 0
|
||||
local_unreads: bool = False
|
||||
local_highlights: bool = False
|
||||
|
||||
# For some reason, Account cannot inherit Presence, because QML keeps
|
||||
# complaining type error on unknown file
|
||||
|
@ -168,7 +167,6 @@ class Room(ModelItem):
|
|||
unreads: int = 0
|
||||
highlights: int = 0
|
||||
local_unreads: bool = False
|
||||
local_highlights: bool = False
|
||||
|
||||
lexical_sorting: bool = False
|
||||
bookmarked: bool = False
|
||||
|
@ -207,7 +205,6 @@ class Room(ModelItem):
|
|||
self.left,
|
||||
bool(other.inviter_id),
|
||||
bool(other.highlights),
|
||||
bool(other.local_highlights),
|
||||
bool(other.unreads),
|
||||
bool(other.local_unreads),
|
||||
other.last_event_date,
|
||||
|
@ -220,7 +217,6 @@ class Room(ModelItem):
|
|||
other.left,
|
||||
bool(self.inviter_id),
|
||||
bool(self.highlights),
|
||||
bool(self.local_highlights),
|
||||
bool(self.unreads),
|
||||
bool(self.local_unreads),
|
||||
self.last_event_date,
|
||||
|
@ -264,7 +260,6 @@ class AccountOrRoom(Account, Room):
|
|||
self.left,
|
||||
bool(other.inviter_id),
|
||||
bool(other.highlights),
|
||||
bool(other.local_highlights),
|
||||
bool(other.unreads),
|
||||
bool(other.local_unreads),
|
||||
other.last_event_date,
|
||||
|
@ -279,7 +274,6 @@ class AccountOrRoom(Account, Room):
|
|||
other.left,
|
||||
bool(self.inviter_id),
|
||||
bool(self.highlights),
|
||||
bool(self.local_highlights),
|
||||
bool(self.unreads),
|
||||
bool(self.local_unreads),
|
||||
self.last_event_date,
|
||||
|
|
|
@ -98,7 +98,6 @@ HTile {
|
|||
unreads: model.total_unread
|
||||
highlights: model.total_highlights
|
||||
localUnreads: model.local_unreads
|
||||
localHighlights: model.local_highlights
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,10 +11,6 @@ HLabel {
|
|||
property int unreads: 0
|
||||
property int highlights: 0
|
||||
property bool localUnreads: false
|
||||
property bool localHighlights: false
|
||||
|
||||
readonly property bool useHighlightStyle:
|
||||
highlights || (! unreads && localUnreads && localHighlights)
|
||||
|
||||
|
||||
text:
|
||||
|
@ -25,13 +21,13 @@ HLabel {
|
|||
""
|
||||
|
||||
color:
|
||||
useHighlightStyle ?
|
||||
highlights ?
|
||||
indicatorTheme.highlightText :
|
||||
indicatorTheme.text
|
||||
|
||||
font.pixelSize: theme.fontSize.small
|
||||
font.bold:
|
||||
useHighlightStyle ?
|
||||
highlights ?
|
||||
indicatorTheme.highlightBold :
|
||||
indicatorTheme.bold
|
||||
|
||||
|
@ -44,22 +40,22 @@ HLabel {
|
|||
|
||||
background: Rectangle {
|
||||
radius:
|
||||
useHighlightStyle ?
|
||||
highlights ?
|
||||
indicatorTheme.highlightRadius :
|
||||
indicatorTheme.radius
|
||||
|
||||
color:
|
||||
useHighlightStyle ?
|
||||
highlights ?
|
||||
indicatorTheme.highlightBackground :
|
||||
indicatorTheme.background
|
||||
|
||||
border.width:
|
||||
useHighlightStyle ?
|
||||
highlights ?
|
||||
indicatorTheme.highlightBorderWidth :
|
||||
indicatorTheme.borderWidth
|
||||
|
||||
border.color:
|
||||
useHighlightStyle ?
|
||||
highlights ?
|
||||
indicatorTheme.highlightBorder :
|
||||
indicatorTheme.border
|
||||
|
||||
|
|
|
@ -77,7 +77,6 @@ HTile {
|
|||
unreads: model.unreads
|
||||
highlights: model.highlights
|
||||
localUnreads: model.local_unreads
|
||||
localHighlights: model.local_highlights
|
||||
}
|
||||
|
||||
HIcon {
|
||||
|
|
|
@ -93,7 +93,7 @@ HListView {
|
|||
|
||||
function cycleUnreadRooms(forward=true, highlights=false) {
|
||||
const prop = highlights ? "highlights" : "unreads"
|
||||
const local_prop = highlights ? "local_highlights" : "local_unreads"
|
||||
const local_prop = highlights ? "highlights" : "local_unreads"
|
||||
const start = currentIndex === -1 ? 0 : currentIndex
|
||||
let index = start
|
||||
|
||||
|
|
|
@ -627,8 +627,7 @@ Rectangle {
|
|||
(
|
||||
chat.roomInfo.unreads ||
|
||||
chat.roomInfo.highlights ||
|
||||
chat.roomInfo.local_unreads ||
|
||||
chat.roomInfo.local_highlights
|
||||
chat.roomInfo.local_unreads
|
||||
) &&
|
||||
Qt.application.state === Qt.ApplicationActive &&
|
||||
eventList.visibleEnd.y > eventList.contentHeight - 100
|
||||
|
|
Loading…
Reference in New Issue
Block a user