|
|
@@ -1507,12 +1507,20 @@ $(document).bind('fatalError.jingle',
|
|
1507
|
1507
|
function onSelectedEndpointChanged(userJid)
|
|
1508
|
1508
|
{
|
|
1509
|
1509
|
console.log('selected endpoint changed: ', userJid);
|
|
1510
|
|
- if (_dataChannels && _dataChannels.length != 0 && _dataChannels[0].readyState == "open") {
|
|
1511
|
|
- _dataChannels[0].send(JSON.stringify({
|
|
1512
|
|
- 'colibriClass': 'SelectedEndpointChangedEvent',
|
|
1513
|
|
- 'selectedEndpoint': (!userJid || userJid == null)
|
|
1514
|
|
- ? null : Strophe.getResourceFromJid(userJid)
|
|
1515
|
|
- }));
|
|
|
1510
|
+ if (_dataChannels && _dataChannels.length != 0)
|
|
|
1511
|
+ {
|
|
|
1512
|
+ _dataChannels.some(function (dataChannel) {
|
|
|
1513
|
+ if (dataChannel.readyState == 'open')
|
|
|
1514
|
+ {
|
|
|
1515
|
+ dataChannel.send(JSON.stringify({
|
|
|
1516
|
+ 'colibriClass': 'SelectedEndpointChangedEvent',
|
|
|
1517
|
+ 'selectedEndpoint': (!userJid || userJid == null)
|
|
|
1518
|
+ ? null : Strophe.getResourceFromJid(userJid)
|
|
|
1519
|
+ }));
|
|
|
1520
|
+
|
|
|
1521
|
+ return true;
|
|
|
1522
|
+ }
|
|
|
1523
|
+ });
|
|
1516
|
1524
|
}
|
|
1517
|
1525
|
}
|
|
1518
|
1526
|
|