Selects the datachannel that is ready for sending notifications to the bridge.
This commit is contained in:
parent
ca3c59f244
commit
e74d27bf88
20
app.js
20
app.js
|
@ -1507,12 +1507,20 @@ $(document).bind('fatalError.jingle',
|
|||
function onSelectedEndpointChanged(userJid)
|
||||
{
|
||||
console.log('selected endpoint changed: ', userJid);
|
||||
if (_dataChannels && _dataChannels.length != 0 && _dataChannels[0].readyState == "open") {
|
||||
_dataChannels[0].send(JSON.stringify({
|
||||
'colibriClass': 'SelectedEndpointChangedEvent',
|
||||
'selectedEndpoint': (!userJid || userJid == null)
|
||||
? null : Strophe.getResourceFromJid(userJid)
|
||||
}));
|
||||
if (_dataChannels && _dataChannels.length != 0)
|
||||
{
|
||||
_dataChannels.some(function (dataChannel) {
|
||||
if (dataChannel.readyState == 'open')
|
||||
{
|
||||
dataChannel.send(JSON.stringify({
|
||||
'colibriClass': 'SelectedEndpointChangedEvent',
|
||||
'selectedEndpoint': (!userJid || userJid == null)
|
||||
? null : Strophe.getResourceFromJid(userJid)
|
||||
}));
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue