-
-
Notifications
You must be signed in to change notification settings - Fork 827
Fix many thinkos in sorting the MemberList #275
Conversation
Change ordering of memberlist to not try to compare lastActive of 'currentlyActive' users, as lastActive may will be a complete lie as it only gets updated when currentlyActive transitions to false (i think?) Remove order by online/idle/offline in favour of "currently active, ordered by power and then alphabetic name, followed by last active, followed by offline" Add commented-out code to track last-spoken-within-a-room ordering. Fix kludges due to SYJS-28 (depends on JS PR landing)
unavailable: 2, | ||
offline: 1 | ||
}; | ||
memberSort: function(now) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this actually need now
? The relative ordering of users will be the same if you set now
to a constant (say, zero), and it would save the extra layer of functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't. i'm a crank. thanks.
Seems sane, modulo concerns about the sorting function. |
@richvdh PTAL |
} | ||
}, | ||
|
||
// returns -1 if a < b. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, my brain is still melting. Please can this be "a comes before b".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, -1 and 1 are not guaranteed. prefer <0
and >0
.
oooooops. final PTAL? |
lgtm |
Remove a spurious } which was introduced in PR #275
Depends on matrix-org/matrix-js-sdk#128