summaryrefslogtreecommitdiffstats
path: root/core/js/jquery.avatar.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js/jquery.avatar.js')
-rw-r--r--core/js/jquery.avatar.js23
1 files changed, 19 insertions, 4 deletions
diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js
index 6ae9cf78a13..754400acd7b 100644
--- a/core/js/jquery.avatar.js
+++ b/core/js/jquery.avatar.js
@@ -74,10 +74,25 @@
user = String(user).replace(/\//g,'');
var $div = this;
+ var url;
- var url = OC.generateUrl(
- '/avatar/{user}/{size}',
- {user: user, size: Math.ceil(size * window.devicePixelRatio)});
+ // If this is our own avatar we have to use the version attribute
+ if (user === OC.getCurrentUser().uid) {
+ url = OC.generateUrl(
+ '/avatar/{user}/{size}?v={version}',
+ {
+ user: user,
+ size: Math.ceil(size * window.devicePixelRatio),
+ version: oc_userconfig.avatar.version
+ });
+ } else {
+ url = OC.generateUrl(
+ '/avatar/{user}/{size}',
+ {
+ user: user,
+ size: Math.ceil(size * window.devicePixelRatio)
+ });
+ }
// If the displayname is not defined we use the old code path
if (typeof(displayname) === 'undefined') {
@@ -122,7 +137,7 @@
$div.show();
$div.text('');
$div.append(img);
- }
+ };
img.width = size;
img.height = size;