From 8146655a70d56659b0fd79c904fad194e2aa5185 Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Fri, 18 Jul 2014 17:36:03 +0200 Subject: [PATCH] Fix bug with starting recording multiple times. --- libs/colibri/colibri.focus.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libs/colibri/colibri.focus.js b/libs/colibri/colibri.focus.js index 56708074b..ed62d818e 100644 --- a/libs/colibri/colibri.focus.js +++ b/libs/colibri/colibri.focus.js @@ -172,7 +172,8 @@ ColibriFocus.prototype.makeConference = function (peers) { }; // Sends a COLIBRI message which enables or disables (according to 'state') the -// recording on the bridge. +// recording on the bridge. Waits for the result IQ and calls 'callback' with +// the new recording state, according to the IQ. ColibriFocus.prototype.setRecording = function(state, token, callback) { var self = this; var elem = $iq({to: this.bridgejid, type: 'get'}); @@ -187,10 +188,7 @@ ColibriFocus.prototype.setRecording = function(state, token, callback) { function (result) { console.log('Set recording "', state, '". Result:', result); var recordingElem = $(result).find('>conference>recording'); - var newState = recordingElem.attr('state'); - if (newState == null){ - newState = false; - } + var newState = ('true' === recordingElem.attr('state')); self.recordingEnabled = newState; callback(newState);