From ea10a1292a7674149581b4332fb0849cd84cf467 Mon Sep 17 00:00:00 2001 From: Daniel Calviño Sánchez Date: Wed, 20 Sep 2017 18:14:00 +0200 Subject: Use "?" instead of user ID as seed for the image placeholder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The seed of the image placeholder is needed to generate the background color of the image, but as the background color is later overriden any seed could be used. When no text is explicitly given the seed is used as text too, so there is no need to pass the user ID and simply using "?" as seed is enough. Signed-off-by: Daniel Calviño Sánchez --- core/js/jquery.avatar.js | 2 +- core/js/tests/specs/jquery.avatarSpec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js index 5813a80646f..c8ac70ac692 100644 --- a/core/js/jquery.avatar.js +++ b/core/js/jquery.avatar.js @@ -113,7 +113,7 @@ $div.imageplaceholder(user, result.data.displayname); } else { // User does not exist - $div.imageplaceholder(user, '?'); + $div.imageplaceholder('?'); $div.css('background-color', '#b9b9b9'); } } else { diff --git a/core/js/tests/specs/jquery.avatarSpec.js b/core/js/tests/specs/jquery.avatarSpec.js index 87767c8bc8f..d7305736690 100644 --- a/core/js/tests/specs/jquery.avatarSpec.js +++ b/core/js/tests/specs/jquery.avatarSpec.js @@ -99,7 +99,7 @@ describe('jquery.avatar tests', function() { }) ); - expect($div.imageplaceholder).toHaveBeenCalledWith('foo', '?'); + expect($div.imageplaceholder).toHaveBeenCalledWith('?'); expect($div.css).toHaveBeenCalledWith('background-color', '#b9b9b9'); }); -- cgit v1.2.3