Browse Source

Use gravatar when enabled.

j8
Jesse Bickel 9 years ago
parent
commit
895bb3fd60
2 changed files with 10 additions and 6 deletions
  1. 1
    1
      index.html
  2. 9
    5
      modules/UI/avatar/Avatar.js

+ 1
- 1
index.html View File

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

+ 9
- 5
modules/UI/avatar/Avatar.js View File

@@ -1,4 +1,4 @@
1
-/* global Strophe, APP, MD5 */
1
+/* global Strophe, APP, MD5, config */
2 2
 var Settings = require("../../settings/Settings");
3 3
 
4 4
 var users = {};
@@ -57,12 +57,16 @@ var Avatar = {
57 57
                 "No avatar stored yet for " + jid + " - using JID as ID");
58 58
             id = jid;
59 59
         }
60
-        return 'https://www.gravatar.com/avatar/' +
61
-            MD5.hexdigest(id.trim().toLowerCase()) +
62
-            "?d=wavatar&size=" + (size || "30");
60
+        if (config.enableThirdPartyRequests === true) {
61
+            return 'https://www.gravatar.com/avatar/' +
62
+                MD5.hexdigest(id.trim().toLowerCase()) +
63
+                "?d=wavatar&size=" + (size || "30");
64
+        } else {
65
+            return 'images/avatar2.png';
66
+        }
63 67
     }
64 68
 
65 69
 };
66 70
 
67 71
 
68
-module.exports = Avatar;
72
+module.exports = Avatar;

Loading…
Cancel
Save