Fix Alt+(Shift+)U/M ignoring local unread rooms

The goTo{Previous,Next}{Unread,Mentioned}Room keybinds only took into
accounts rooms that had a server-sent unread/highlight count, and not
those that only had a client-side unread "!" badge (e.g. for rooms that
get new messages but that have push rules disabling notifications).
This commit is contained in:
miruka 2020-10-22 20:30:23 -04:00
parent 4c04c1158c
commit 63fe083cad

View File

@ -92,9 +92,10 @@ HListView {
} }
function cycleUnreadRooms(forward=true, highlights=false) { function cycleUnreadRooms(forward=true, highlights=false) {
const prop = highlights ? "highlights" : "unreads" const prop = highlights ? "highlights" : "unreads"
const start = currentIndex === -1 ? 0 : currentIndex const local_prop = highlights ? "local_highlights" : "local_unreads"
let index = start const start = currentIndex === -1 ? 0 : currentIndex
let index = start
while (true) { while (true) {
index += forward ? 1 : -1 index += forward ? 1 : -1
@ -109,7 +110,7 @@ HListView {
const item = model.get(index) const item = model.get(index)
if (item.type === "Room" && item[prop]) { if (item.type === "Room" && (item[prop] || item[local_prop])) {
currentIndex = index currentIndex = index
return true return true
} }