From 84a8d00234db2d3818f3cb497905784d69079891 Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Wed, 22 Jul 2015 15:30:42 -0500 Subject: [PATCH] Renames functions for the sake of clarity. --- modules/UI/UI.js | 4 ++-- modules/UI/authentication/Authentication.js | 2 +- modules/UI/toolbars/Toolbar.js | 2 +- modules/xmpp/strophe.emuc.js | 1 - modules/xmpp/strophe.jingle.js | 4 ++-- modules/xmpp/xmpp.js | 19 ++++++++----------- 6 files changed, 14 insertions(+), 18 deletions(-) diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 0bc1d2801..fe0b138c8 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -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; } diff --git a/modules/UI/authentication/Authentication.js b/modules/UI/authentication/Authentication.js index 9cefee1b2..a3995986f 100644 --- a/modules/UI/authentication/Authentication.js +++ b/modules/UI/authentication/Authentication.js @@ -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(); } }); diff --git a/modules/UI/toolbars/Toolbar.js b/modules/UI/toolbars/Toolbar.js index 16e2af2ca..e6c205592 100644 --- a/modules/UI/toolbars/Toolbar.js +++ b/modules/UI/toolbars/Toolbar.js @@ -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; diff --git a/modules/xmpp/strophe.emuc.js b/modules/xmpp/strophe.emuc.js index 0b04fb60f..db77adae2 100644 --- a/modules/xmpp/strophe.emuc.js +++ b/modules/xmpp/strophe.emuc.js @@ -4,7 +4,6 @@ */ var XMPPEvents = require("../../service/xmpp/XMPPEvents"); var Moderator = require("./moderator"); -var JingleSession = require("./JingleSession"); var bridgeIsDown = false; diff --git a/modules/xmpp/strophe.jingle.js b/modules/xmpp/strophe.jingle.js index 4eac5c3bc..7a8455537 100644 --- a/modules/xmpp/strophe.jingle.js +++ b/modules/xmpp/strophe.jingle.js @@ -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) { diff --git a/modules/xmpp/xmpp.js b/modules/xmpp/xmpp.js index d8dd45fdb..8ca0f1553 100644 --- a/modules/xmpp/xmpp.js +++ b/modules/xmpp/xmpp.js @@ -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 () {