diff --git a/modules/settings/Settings.js b/modules/settings/Settings.js index 4dd05d543..2d322e22e 100644 --- a/modules/settings/Settings.js +++ b/modules/settings/Settings.js @@ -36,16 +36,33 @@ if (supportsLocalStorage()) { } var Settings = { + + /** + * Sets the local user display name and saves it to local storage + * + * @param newDisplayName the new display name for the local user + * @returns {string} the display name we just set + */ setDisplayName: function (newDisplayName) { displayName = newDisplayName; window.localStorage.displayname = displayName; return displayName; }, + + /** + * Returns the currently used by the user + * @returns {string} currently valid user display name. + */ + getDisplayName: function () { + return displayName; + }, + setEmail: function (newEmail) { email = newEmail; window.localStorage.email = newEmail; return email; }, + getSettings: function () { return { email: email, diff --git a/modules/statistics/CallStats.js b/modules/statistics/CallStats.js index 1adc7082b..9fac6cc41 100644 --- a/modules/statistics/CallStats.js +++ b/modules/statistics/CallStats.js @@ -1,4 +1,6 @@ /* global config, $, APP, Strophe, callstats */ + +var Settings = require('../settings/Settings'); var jsSHA = require('jssha'); var io = require('socket.io-client'); var callStats = null; @@ -20,6 +22,10 @@ var CallStats = { this.userID = APP.xmpp.myResource(); + //use whatever the user said to facilitate debugging + if(Settings.getDisplayName()) + this.userID = Settings.getDisplayName(); + var location = window.location; this.confID = location.hostname + location.pathname;