summaryrefslogtreecommitdiffstats
path: root/core/js/jquery.avatar.js
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2013-09-28 16:46:53 +0200
committerkondou <kondou@ts.unde.re>2013-09-28 16:46:53 +0200
commit4907685405ead5df56ef0a5ac0b9af7c86885487 (patch)
treef63b1334a0474a448f2541ba310b5899ea985a48 /core/js/jquery.avatar.js
parentcb565a5f60921f3fdf3c42df12951e02a3bb338d (diff)
downloadnextcloud-server-4907685405ead5df56ef0a5ac0b9af7c86885487.tar.gz
nextcloud-server-4907685405ead5df56ef0a5ac0b9af7c86885487.zip
Base defaultavatar text on displayname
Fix #4876
Diffstat (limited to 'core/js/jquery.avatar.js')
-rw-r--r--core/js/jquery.avatar.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js
index f1382fd7d2d..88a4c25d1ee 100644
--- a/core/js/jquery.avatar.js
+++ b/core/js/jquery.avatar.js
@@ -69,7 +69,11 @@
var url = OC.Router.generate('core_avatar_get', {user: user, size: size})+'?requesttoken='+oc_requesttoken;
$.get(url, function(result) {
if (typeof(result) === 'object') {
- $div.placeholder(user);
+ if (result.data && result.data.displayname) {
+ $div.placeholder(user, result.data.displayname);
+ } else {
+ $div.placeholder(user);
+ }
} else {
if (ie8fix === true) {
$div.html('<img src="'+url+'#'+Math.floor(Math.random()*1000)+'">');