feat(log): Logs server field from jwt token
This commit is contained in:
parent
8f4b94f732
commit
fcc9532bde
5
app.js
5
app.js
|
@ -110,6 +110,11 @@ function init() {
|
|||
var isUIReady = APP.UI.start();
|
||||
if (isUIReady) {
|
||||
APP.conference.init({roomName: buildRoomName()}).then(function () {
|
||||
let server = APP.tokenData.server;
|
||||
if(server) {
|
||||
APP.conference.logEvent("server." + server, 1);
|
||||
}
|
||||
|
||||
APP.UI.initConference();
|
||||
|
||||
APP.UI.addListener(UIEvents.LANG_CHANGED, function (language) {
|
||||
|
|
|
@ -1766,5 +1766,20 @@ export default {
|
|||
// Update the view
|
||||
APP.UI.setLocalRaisedHandStatus(raisedHand);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Log event to callstats and analytics.
|
||||
* @param {string} name the event name
|
||||
* @param {int} value the value (it's int because google analytics supports
|
||||
* only int).
|
||||
* NOTE: Should be used after conference.init
|
||||
*/
|
||||
logEvent(name, value) {
|
||||
if(JitsiMeetJS.analytics) {
|
||||
JitsiMeetJS.analytics.sendEvent(name, value);
|
||||
}
|
||||
if(room) {
|
||||
room.sendApplicationLog(JSON.stringify({name, value}));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -97,6 +97,7 @@ class TokenData{
|
|||
this.payload = this.decodedJWT.payload;
|
||||
if(!this.payload.context)
|
||||
return;
|
||||
this.server = this.payload.context.server;
|
||||
let callerData = this.payload.context.user;
|
||||
let calleeData = this.payload.context.callee;
|
||||
if(callerData)
|
||||
|
|
Loading…
Reference in New Issue