The difference in case sensitivity is the most obvious change with
servers like soju that support CASEMAPPING ascii and
rfc1459. Currently the list:
'Alpha', 'aardvark', 'Charlie', 'comma'
currently sorts to:
'Alpha', 'Charlie', 'aardvark', 'comma'
with this change it will instead become:
'aardvark', 'Alpha', 'Charlie', 'comma'
If something like RFC 7613 gets broader support then there are a few
more differences for a list like:
'éclair', 'ecstatic, 'aardvark', 'zed', 'Gamma'
currently sorts to:
'Gamma', 'aardvark', 'ecstatic', 'zed', 'éclair'
with this patch would instead sort to:
'aardvark', 'éclair', 'ecstatic', 'Gamma', 'zed'
The above examples were run with a locale unspecified which fell back
to my browser/host default of 'en'.
diff --git a/components/member-list.js b/components/member-list.js
--- a/components/member-list.js+++ b/components/member-list.js
@@ -101,7 +101,7 @@ function sortMembers(a, b) {
return i - j;
}
- return nickA < nickB ? -1 : 1;+ return nickA.localeCompare(nickB);}
export default class MemberList extends Component {
diff --git a/state.js b/state.js
--- a/state.js+++ b/state.js
@@ -151,13 +151,13 @@ function isServerBuffer(buf) {
* 0 otherwise. */
function compareBuffers(a, b) {
if (a.server != b.server) {
- return a.server > b.server ? 1 : -1;+ return a.server.localeCompare(b.server); }
if (isServerBuffer(a) != isServerBuffer(b)) {
return isServerBuffer(b) ? 1 : -1;
}
if (a.name != b.name) {
- return a.name > b.name ? 1 : -1;+ return a.name.localeCompare(b.name); }
return 0;
}
Pushed, with a minor edit to remove the localeCompare() call for buffer
servers, because these are numerical IDs. (We should use server names
instead, but it's a TODO.)
Thanks!