Преглед изворни кода

add display name to stats debug info

efficient_tiling
Emil Ivov пре 10 година
родитељ
комит
097c008a63
2 измењених фајлова са 23 додато и 0 уклоњено
  1. 17
    0
      modules/settings/Settings.js
  2. 6
    0
      modules/statistics/CallStats.js

+ 17
- 0
modules/settings/Settings.js Прегледај датотеку

36
 }
36
 }
37
 
37
 
38
 var Settings = {
38
 var Settings = {
39
+
40
+    /**
41
+     * Sets the local user display name and saves it to local storage
42
+     *
43
+     * @param newDisplayName the new display name for the local user
44
+     * @returns {string} the display name we just set
45
+     */
39
     setDisplayName: function (newDisplayName) {
46
     setDisplayName: function (newDisplayName) {
40
         displayName = newDisplayName;
47
         displayName = newDisplayName;
41
         window.localStorage.displayname = displayName;
48
         window.localStorage.displayname = displayName;
42
         return displayName;
49
         return displayName;
43
     },
50
     },
51
+
52
+    /**
53
+     * Returns the currently used by the user
54
+     * @returns {string} currently valid user display name.
55
+     */
56
+    getDisplayName: function () {
57
+        return displayName;
58
+    },
59
+
44
     setEmail: function (newEmail) {
60
     setEmail: function (newEmail) {
45
         email = newEmail;
61
         email = newEmail;
46
         window.localStorage.email = newEmail;
62
         window.localStorage.email = newEmail;
47
         return email;
63
         return email;
48
     },
64
     },
65
+
49
     getSettings: function () {
66
     getSettings: function () {
50
         return {
67
         return {
51
             email: email,
68
             email: email,

+ 6
- 0
modules/statistics/CallStats.js Прегледај датотеку

1
 /* global config, $, APP, Strophe, callstats */
1
 /* global config, $, APP, Strophe, callstats */
2
+
3
+var Settings = require('../settings/Settings');
2
 var jsSHA = require('jssha');
4
 var jsSHA = require('jssha');
3
 var io = require('socket.io-client');
5
 var io = require('socket.io-client');
4
 var callStats = null;
6
 var callStats = null;
20
 
22
 
21
         this.userID =  APP.xmpp.myResource();
23
         this.userID =  APP.xmpp.myResource();
22
 
24
 
25
+        //use whatever the user said to facilitate debugging
26
+        if(Settings.getDisplayName())
27
+            this.userID = Settings.getDisplayName();
28
+
23
         var location = window.location;
29
         var location = window.location;
24
         this.confID = location.hostname + location.pathname;
30
         this.confID = location.hostname + location.pathname;
25
 
31
 

Loading…
Откажи
Сачувај