Use gravatar when enabled.

This commit is contained in:
Jesse Bickel 2015-12-07 14:41:35 -06:00
parent 3f42f8bf67
commit 895bb3fd60
2 changed files with 10 additions and 6 deletions

View File

@ -201,7 +201,7 @@
</div>
<div id="settingsmenu" class="right-panel">
<div class="icon-settings" data-i18n="settings.title"></div>
<img id="avatar" src="https://www.gravatar.com/avatar/87291c37c25be69a072a4514931b1749?d=wavatar&size=30"/>
<img id="avatar" src="images/avatar2.png"/>
<div class="arrow-up"></div>
<input type="text" id="setDisplayName" data-i18n="[placeholder]settings.name" placeholder="Name">
<input type="text" id="setEmail" placeholder="E-Mail">

View File

@ -1,4 +1,4 @@
/* global Strophe, APP, MD5 */
/* global Strophe, APP, MD5, config */
var Settings = require("../../settings/Settings");
var users = {};
@ -57,12 +57,16 @@ var Avatar = {
"No avatar stored yet for " + jid + " - using JID as ID");
id = jid;
}
return 'https://www.gravatar.com/avatar/' +
MD5.hexdigest(id.trim().toLowerCase()) +
"?d=wavatar&size=" + (size || "30");
if (config.enableThirdPartyRequests === true) {
return 'https://www.gravatar.com/avatar/' +
MD5.hexdigest(id.trim().toLowerCase()) +
"?d=wavatar&size=" + (size || "30");
} else {
return 'images/avatar2.png';
}
}
};
module.exports = Avatar;
module.exports = Avatar;