From bf944d921945601ee4b984684e16c956a4991f59 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 11 Nov 2014 05:50:55 +0000 Subject: [PATCH] fix stupid truncation bug --- syweb/webclient/components/matrix/event-handler-service.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/syweb/webclient/components/matrix/event-handler-service.js b/syweb/webclient/components/matrix/event-handler-service.js index 34c6f34981..f51031f4cd 100644 --- a/syweb/webclient/components/matrix/event-handler-service.js +++ b/syweb/webclient/components/matrix/event-handler-service.js @@ -304,6 +304,7 @@ function(matrixService, $rootScope, $q, $timeout, $filter, mPresence, notificati */ var getUserDisplayName = function(room_id, user_id, wrap) { var displayName; + // XXX: this is getting called *way* too often - at least once per every room member per every digest... // Get the user display name from the member list of the room var member = modelService.getMember(room_id, user_id); @@ -337,14 +338,16 @@ function(matrixService, $rootScope, $q, $timeout, $filter, mPresence, notificati if (undefined === displayName) { // By default, use the user ID - displayName = user_id; - if (wrap) { + if (wrap && user_id.indexOf(':') >= 0) { displayName = user_id.substr(0, user_id.indexOf(':')) + " " + user_id.substr(user_id.indexOf(':')); } else { displayName = user_id; } } + + //console.log("getUserDisplayName(" + room_id + ", " + user_id + ", " + wrap +") = " + displayName); + return displayName; };