Synchronizing with a remote CardDAV server (#42, #138, #139)

+ Updated contacts sql shema (breaking changes)
+ Fixes
- Removed SabreDAV Server
- Removed Contacts Sharing (awhile, code refactoring)
This commit is contained in:
RainLoop Team 2014-04-26 01:50:17 +04:00
parent 54a4c2657a
commit d29f20789f
78 changed files with 2024 additions and 2317 deletions

View file

@ -8,6 +8,7 @@ function AbstractCacheStorage()
this.oEmailsPicsHashes = {};
this.oServices = {};
}
/**
* @type {Object}
*/
@ -28,26 +29,36 @@ AbstractCacheStorage.prototype.clear = function ()
* @param {string} sEmail
* @return {string}
*/
AbstractCacheStorage.prototype.getUserPic = function (sEmail)
AbstractCacheStorage.prototype.getUserPic = function (sEmail, fCallback)
{
sEmail = Utils.trim(sEmail);
var
sUrl = '',
sService = '',
sEmailLower = sEmail.toLowerCase(),
sPicHash = Utils.isUnd(this.oEmailsPicsHashes[sEmail]) ? '' : this.oEmailsPicsHashes[sEmail]
sPicHash = Utils.isUnd(this.oEmailsPicsHashes[sEmailLower]) ? '' : this.oEmailsPicsHashes[sEmailLower]
;
if ('' === sPicHash)
if ('' !== sPicHash)
{
sUrl = RL.link().getUserPicUrlFromHash(sPicHash);
}
else
{
sService = sEmailLower.substr(sEmail.indexOf('@') + 1);
sUrl = '' !== sService && this.oServices[sService] ? this.oServices[sService] : '';
}
else
{
sUrl = RL.link().getUserPicUrlFromHash(sPicHash);
}
return sUrl;
// if ('' === sUrl) // Gravatar // TODO
// {
// fCallback('//secure.gravatar.com/avatar/' + Utils.md5(sEmailLower) + '.jpg?s=80&d=mm', sEmail);
// }
// else
// {
fCallback(sUrl, sEmail);
// }
};
/**