diff --git a/conference.js b/conference.js index 3cf2e7834..4d5feabb4 100644 --- a/conference.js +++ b/conference.js @@ -270,6 +270,9 @@ export default { }, // end used by torture + getLogs () { + return room.getLogs(); + }, _createRoom () { room = connection.initJitsiConference(APP.conference.roomName, this._getConferenceOptions()); @@ -286,6 +289,7 @@ export default { }); roomLocker = createRoomLocker(room); this._room = room; // FIXME do not use this + this.localId = room.myUserId(); let email = APP.settings.getEmail(); email && sendEmail(email); diff --git a/libs/lib-jitsi-meet.js b/libs/lib-jitsi-meet.js index 79e27c81b..1b0d2ae7e 100644 --- a/libs/lib-jitsi-meet.js +++ b/libs/lib-jitsi-meet.js @@ -698,6 +698,27 @@ JitsiConference.prototype.isStartVideoMuted = function () { return this.startVideoMuted; }; +/** + * Get object with internal logs. + */ +JitsiConference.prototype.getLogs = function () { + var data = this.xmpp.getJingleLog(); + + var metadata = {}; + metadata.time = new Date(); + metadata.url = window.location.href; + metadata.ua = navigator.userAgent; + + var log = this.xmpp.getXmppLog(); + if (log) { + metadata.xmpp = log; + } + + data.metadata = metadata; + + return data; +}; + /** * Setups the listeners needed for the conference. * @param conference the conference @@ -3684,6 +3705,7 @@ var ScreenObtainer = { * 'desktop' stream for returned stream token. */ obtainScreenFromExtension: function (streamCallback, failCallback) { + var self = this; if (chromeExtInstalled) { doGetStreamFromExtension(this.options, streamCallback, failCallback); @@ -3702,7 +3724,7 @@ var ScreenObtainer = { // We need to give a moment for the endpoint to become // available window.setTimeout(function () { - doGetStreamFromExtension(this.options, streamCallback, + doGetStreamFromExtension(self.options, streamCallback, failCallback); }, 500); }, @@ -12519,22 +12541,6 @@ XMPP.prototype.disconnect = function () { this.connection.disconnect(); }; -/** - * Gets the SSRC of local media stream. - * @param mediaType the media type that tells whether we want to get - * the SSRC of local audio or video stream. - * @returns {*} the SSRC number for local media stream or null if - * not available. - */ -XMPP.prototype.getLocalSSRC = function (mediaType) { - if (this.connection.jingle.activecall && - this.connection.jingle.activecall.peerconnection) { - return this.connection.jingle.activecall.getLocalSSRC(mediaType); - } else { - return null; - } -}; - module.exports = XMPP; }).call(this,"/modules/xmpp/xmpp.js") diff --git a/modules/UI/UI.js b/modules/UI/UI.js index ca2a4b5d3..8b31f42e3 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -279,8 +279,12 @@ UI.start = function () { $('#notice').css({display: 'block'}); } $("#downloadlog").click(function (event) { - // dump(event.target); - // FIXME integrate logs + let logs = APP.conference.getLogs(); + let data = encodeURIComponent(JSON.stringify(logs, null, ' ')); + + let elem = event.target.parentNode; + elem.download = 'meetlog.json'; + elem.href = 'data:application/json;charset=utf-8,\n' + data; }); Feedback.init(); } else {