Sort typing members by display name
This commit is contained in:
parent
2923d440d0
commit
0ac4874ddf
|
@ -2,16 +2,26 @@ Qt.include("../utils.js")
|
||||||
|
|
||||||
|
|
||||||
function typingTextFor(members, our_user_id) {
|
function typingTextFor(members, our_user_id) {
|
||||||
var names = []
|
var profiles = []
|
||||||
|
var names = []
|
||||||
|
|
||||||
for (var i = 0; i < members.length; i++) {
|
for (var i = 0; i < members.length; i++) {
|
||||||
if (members[i] != our_user_id) {
|
if (members[i] != our_user_id) {
|
||||||
names.push(coloredNameHtml(
|
profiles.push(users.getUser(members[i]))
|
||||||
users.getUser(members[i]).displayName, members[i]
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
profiles.sort(function(left, right) {
|
||||||
|
if (left.displayName < right.displayName) { return -1 }
|
||||||
|
if (left.displayName > right.displayName) { return +1 }
|
||||||
|
return 0
|
||||||
|
})
|
||||||
|
|
||||||
|
for (var i = 0; i < profiles.length; i++) {
|
||||||
|
var profile = profiles[i]
|
||||||
|
names.push(coloredNameHtml(profile.displayName, profile.userId))
|
||||||
|
}
|
||||||
|
|
||||||
if (names.length == 0) { return "" }
|
if (names.length == 0) { return "" }
|
||||||
if (names.length == 1) { return qsTr("%1 is typing...").arg(names[0]) }
|
if (names.length == 1) { return qsTr("%1 is typing...").arg(names[0]) }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user