Przeglądaj źródła

Fix data channel suport with newer Janus versions

When Janus is used even if it is possible to open several data channels
with different labels and send data on them all the messages are
received in the first data channel opened.

In Talk the "status" data channel is used to send the data channel
messages, and before Janus 0.7.0 it was the first data channel opened,
so the messages were received on it.

However, since Janus 0.7.0 the data channel messages are received
instead on a data channel opened by Janus, which is named
"JanusDataChannel". It is not possible to change that behaviour on Janus
except by patching it, so for broader compatibility the messages
received in "JanusDataChannel" are treated like messages received in the
"status" data channel

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Daniel Calviño Sánchez 4 lat temu
rodzic
commit
fcb45e94f3

+ 1 - 1
app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionWrapper.java

@@ -406,7 +406,7 @@ public class MagicPeerConnectionWrapper {
 
         @Override
         public void onDataChannel(DataChannel dataChannel) {
-            if (dataChannel.label().equals("status")) {
+            if (dataChannel.label().equals("status") || dataChannel.label().equals("JanusDataChannel")) {
                 magicDataChannel = dataChannel;
                 magicDataChannel.registerObserver(new MagicDataChannelObserver());
             }