Removes unused vars from moderatemuc.js. and fixes jshint warnings.

This commit is contained in:
paweldomas 2014-11-28 16:16:04 +01:00
parent 9d3aef2efa
commit a0fef34a1f
1 changed files with 10 additions and 17 deletions

View File

@ -1,27 +1,20 @@
/* global $, $iq, config, connection, Strophe, toggleAudio */
/** /**
* Moderate connection plugin. * Moderate connection plugin.
*/ */
Strophe.addConnectionPlugin('moderate', { Strophe.addConnectionPlugin('moderate', {
connection: null, connection: null,
roomjid: null,
myroomjid: null,
members: {},
list_members: [], // so we can elect a new focus
presMap: {},
preziMap: {},
joined: false,
isOwner: false,
init: function (conn) { init: function (conn) {
this.connection = conn; this.connection = conn;
this.connection.addHandler( this.onMute.bind(this), this.connection.addHandler(this.onMute.bind(this),
'http://jitsi.org/jitmeet/audio', 'http://jitsi.org/jitmeet/audio',
'iq', 'iq',
'set', 'set',
null, null,
null); null);
}, },
setMute: function(jid, mute) { setMute: function (jid, mute) {
var iq = $iq({to: jid, type: 'set'}) var iq = $iq({to: jid, type: 'set'})
.c('mute', {xmlns: 'http://jitsi.org/jitmeet/audio'}) .c('mute', {xmlns: 'http://jitsi.org/jitmeet/audio'})
.t(mute.toString()) .t(mute.toString())
@ -39,14 +32,14 @@ Strophe.addConnectionPlugin('moderate', {
"participant" + '.', error); "participant" + '.', error);
}); });
}, },
onMute: function(iq) { onMute: function (iq) {
var mute = $(iq).find('mute'); var mute = $(iq).find('mute');
if (mute.length) { if (mute.length) {
toggleAudio(); toggleAudio();
} }
return true; return true;
}, },
eject: function(jid) { eject: function (jid) {
connection.jingle.terminateRemoteByJid(jid, 'kick'); connection.jingle.terminateRemoteByJid(jid, 'kick');
connection.emuc.kick(jid); connection.emuc.kick(jid);
} }