Renames functions for the sake of clarity.

This commit is contained in:
Boris Grozev 2015-07-22 15:30:42 -05:00
parent ee95e99f57
commit 84a8d00234
6 changed files with 14 additions and 18 deletions

View File

@ -767,12 +767,12 @@ function dump(elem, filename) {
elem = elem.parentNode;
elem.download = filename || 'meetlog.json';
elem.href = 'data:application/json;charset=utf-8,\n';
var data = APP.xmpp.populateData();
var data = APP.xmpp.getJingleLog();
var metadata = {};
metadata.time = new Date();
metadata.url = window.location.href;
metadata.ua = navigator.userAgent;
var log = APP.xmpp.getLogger();
var log = APP.xmpp.getXmppLog();
if (log) {
metadata.xmpp = log;
}

View File

@ -79,7 +79,7 @@ var Authentication = {
Moderator.allocateConferenceFocus(roomName, function () {
// If it's not "on the fly" authentication now join
// the conference room
if (!APP.xmpp.getMUCJoined()) {
if (!APP.xmpp.isMUCJoined()) {
APP.UI.checkForNicknameAndJoin();
}
});

View File

@ -298,7 +298,7 @@ var Toolbar = (function (my) {
return;
}
// Get authentication URL
if (!APP.xmpp.getMUCJoined()) {
if (!APP.xmpp.isMUCJoined()) {
APP.xmpp.getLoginUrl(UI.getRoomName(), function (url) {
// If conference has not been started yet - redirect to login page
window.location.href = url;

View File

@ -4,7 +4,6 @@
*/
var XMPPEvents = require("../../service/xmpp/XMPPEvents");
var Moderator = require("./moderator");
var JingleSession = require("./JingleSession");
var bridgeIsDown = false;

View File

@ -329,9 +329,9 @@ module.exports = function(XMPP, eventEmitter)
},
/**
* Populates the log data
* Returns the data saved in 'updateLog' in a format to be logged.
*/
populateData: function () {
getLog: function () {
var data = {};
var self = this;
Object.keys(this.sessions).forEach(function (sid) {

View File

@ -482,17 +482,13 @@ var XMPP = {
connection.send(message);
return true;
},
populateData: function () {
var data = {};
if (connection.jingle) {
data = connection.jingle.populateData();
}
return data;
// Gets the logs from strophe.jingle.
getJingleLog: function () {
return connection.jingle ? connection.jingle.getLog() : {};
},
getLogger: function () {
if(connection.logger)
return connection.logger.log;
return null;
// Gets the logs from strophe.
getXmppLog: function () {
return connection.logger ? connection.logger.log : null;
},
getPrezi: function () {
return connection.emuc.getPrezi(this.myJid());
@ -533,7 +529,8 @@ var XMPP = {
return null;
return connection.jingle.activecall.getSsrcOwner(ssrc);
},
getMUCJoined: function () {
// Returns true iff we have joined the MUC.
isMUCJoined: function () {
return connection.emuc.joined;
},
getSessions: function () {