mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-16 04:34:42 +08:00
4cc2207513
Original unminified source code (dev folder - js, css, less) (fixes #6) Grunt build system Multiple identities correction (fixes #9) Compose html editor (fixes #12) New general settings - Loading Description New warning about default admin password Split general and login screen settings
67 lines
1.2 KiB
JavaScript
67 lines
1.2 KiB
JavaScript
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
|
|
|
/**
|
|
* @constructor
|
|
*/
|
|
function AbstractCacheStorage()
|
|
{
|
|
this.oEmailsPicsHashes = {};
|
|
this.oServices = {};
|
|
}
|
|
/**
|
|
* @type {Object}
|
|
*/
|
|
AbstractCacheStorage.prototype.oEmailsPicsHashes = {};
|
|
|
|
/**
|
|
* @type {Object}
|
|
*/
|
|
AbstractCacheStorage.prototype.oServices = {};
|
|
|
|
AbstractCacheStorage.prototype.clear = function ()
|
|
{
|
|
this.oServices = {};
|
|
this.oEmailsPicsHashes = {};
|
|
};
|
|
|
|
/**
|
|
* @param {string} sEmail
|
|
* @return {string}
|
|
*/
|
|
AbstractCacheStorage.prototype.getUserPic = function (sEmail)
|
|
{
|
|
var
|
|
sUrl = '',
|
|
sService = '',
|
|
sEmailLower = sEmail.toLowerCase(),
|
|
sPicHash = Utils.isUnd(this.oEmailsPicsHashes[sEmail]) ? '' : this.oEmailsPicsHashes[sEmail]
|
|
;
|
|
|
|
if ('' === sPicHash)
|
|
{
|
|
sService = sEmailLower.substr(sEmail.indexOf('@') + 1);
|
|
sUrl = '' !== sService && this.oServices[sService] ? this.oServices[sService] : '';
|
|
}
|
|
else
|
|
{
|
|
sUrl = RL.link().getUserPicUrlFromHash(sPicHash);
|
|
}
|
|
|
|
return sUrl;
|
|
};
|
|
|
|
/**
|
|
* @param {Object} oData
|
|
*/
|
|
AbstractCacheStorage.prototype.setServicesData = function (oData)
|
|
{
|
|
this.oServices = oData;
|
|
};
|
|
|
|
/**
|
|
* @param {Object} oData
|
|
*/
|
|
AbstractCacheStorage.prototype.setEmailsPicsHashesData = function (oData)
|
|
{
|
|
this.oEmailsPicsHashes = oData;
|
|
};
|