mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-08 16:34:56 -04:00
Fixed SYWEB-36: use getUserDisplayName for disambiguating display name in member list and message sender name. This method is robust when disambiguation is no more required
This commit is contained in:
parent
ef99a5d972
commit
9d3246ed12
2 changed files with 10 additions and 24 deletions
|
@ -45,28 +45,6 @@ angular.module('matrixWebClient')
|
|||
angular.forEach(members, function(value, key) {
|
||||
value["id"] = key;
|
||||
filtered.push( value );
|
||||
if (value["displayname"]) {
|
||||
if (!displayNames[value["displayname"]]) {
|
||||
displayNames[value["displayname"]] = [];
|
||||
}
|
||||
displayNames[value["displayname"]].push(key);
|
||||
}
|
||||
});
|
||||
|
||||
// FIXME: we shouldn't disambiguate displayNames on every orderMembersList
|
||||
// invocation but keep track of duplicates incrementally somewhere
|
||||
angular.forEach(displayNames, function(value, key) {
|
||||
if (value.length > 1) {
|
||||
// console.log(key + ": " + value);
|
||||
for (var i=0; i < value.length; i++) {
|
||||
var v = value[i];
|
||||
// FIXME: this permenantly rewrites the displayname for a given
|
||||
// room member. which means we can't reset their name if it is
|
||||
// no longer ambiguous!
|
||||
members[v].displayname += " (" + v + ")";
|
||||
// console.log(v + " " + members[v]);
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
filtered.sort(function (a, b) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue