This commit is contained in:
RainLoop Team 2014-05-05 00:36:48 +04:00
parent e5ded48d14
commit 3328bcd9eb
14 changed files with 88 additions and 30 deletions

View file

@ -7,6 +7,7 @@ function AbstractCacheStorage()
{
this.oEmailsPicsHashes = {};
this.oServices = {};
this.bAllowGravatar = !!RL.settingsGet('AllowGravatar');
}
/**
@ -19,6 +20,11 @@ AbstractCacheStorage.prototype.oEmailsPicsHashes = {};
*/
AbstractCacheStorage.prototype.oServices = {};
/**
* @type {boolean}
*/
AbstractCacheStorage.prototype.bAllowGravatar = false;
AbstractCacheStorage.prototype.clear = function ()
{
this.oServices = {};
@ -51,14 +57,14 @@ AbstractCacheStorage.prototype.getUserPic = function (sEmail, fCallback)
}
// if ('' === sUrl) // Gravatar // TODO
// {
// fCallback('//secure.gravatar.com/avatar/' + Utils.md5(sEmailLower) + '.jpg?s=80&d=mm', sEmail);
// }
// else
// {
if (this.bAllowGravatar && '' === sUrl)
{
fCallback('//secure.gravatar.com/avatar/' + Utils.md5(sEmailLower) + '.jpg?s=80&d=mm', sEmail);
}
else
{
fCallback(sUrl, sEmail);
// }
}
};
/**