From 5835948a3daf15c44f55be23689200013aac7ef6 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 19 May 2016 23:00:28 +0100 Subject: [PATCH] ignore @ prefixes when sorting memberlist --- src/components/views/rooms/MemberList.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/MemberList.js b/src/components/views/rooms/MemberList.js index f029c519bc..a1769ad5f3 100644 --- a/src/components/views/rooms/MemberList.js +++ b/src/components/views/rooms/MemberList.js @@ -387,7 +387,9 @@ module.exports = React.createClass({ // console.log(memberA + " and " + memberB + " have same power level"); if (memberA.name && memberB.name) { // console.log("comparing names: " + memberA.name + " and " + memberB.name); - return memberA.name.localeCompare(memberB.name); + var nameA = memberA.name[0] === '@' ? memberA.name.substr(1) : memberA.name; + var nameB = memberB.name[0] === '@' ? memberB.name.substr(1) : memberB.name; + return nameA.localeCompare(nameB); } else { return 0;