Use gravatar when enabled.

pull/441/head
Jesse Bickel 9 years ago committed by Boris Grozev
parent 46a5c909c8
commit fd9485b7e5
  1. 2
      index.html
  2. 14
      modules/UI/avatar/Avatar.js

@ -202,7 +202,7 @@
</div> </div>
<div id="settingsmenu" class="right-panel"> <div id="settingsmenu" class="right-panel">
<div class="icon-settings" data-i18n="settings.title"></div> <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> <div class="arrow-up"></div>
<input type="text" id="setDisplayName" data-i18n="[placeholder]settings.name" placeholder="Name"> <input type="text" id="setDisplayName" data-i18n="[placeholder]settings.name" placeholder="Name">
<input type="text" id="setEmail" placeholder="E-Mail"> <input type="text" id="setEmail" placeholder="E-Mail">

@ -1,4 +1,6 @@
/* global MD5 */ /* global Strophe, APP, MD5, config */
var Settings = require("../../settings/Settings");
var users = {}; var users = {};
var Avatar = { var Avatar = {
@ -53,9 +55,13 @@ var Avatar = {
); );
email = id; email = id;
} }
return 'https://www.gravatar.com/avatar/' + if (config.enableThirdPartyRequests === true) {
MD5.hexdigest(email.trim().toLowerCase()) + return 'https://www.gravatar.com/avatar/' +
"?d=wavatar&size=" + (size || "30"); MD5.hexdigest(id.trim().toLowerCase()) +
"?d=wavatar&size=" + (size || "30");
} else {
return 'images/avatar2.png';
}
} }
}; };

Loading…
Cancel
Save