Simplify getting the message type

The message type is set for all signaling messages. On the other hand,
the payload type is only set for offers and answers (and, if the message
was sent by the Android app, also for candidates). However, in all those
cases the payload type just duplicates the message type, so the message
type can be assigned directly rather than falling back to it if there is
no payload type.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2022-10-17 10:30:46 +02:00
parent 55d923394c
commit 7b1bfb2c17

View File

@ -1664,12 +1664,7 @@ public class CallActivity extends CallBaseActivity {
private void processMessage(NCSignalingMessage ncSignalingMessage) {
if ("video".equals(ncSignalingMessage.getRoomType()) || "screen".equals(ncSignalingMessage.getRoomType())) {
String type = null;
if (ncSignalingMessage.getPayload() != null && ncSignalingMessage.getPayload().getType() != null) {
type = ncSignalingMessage.getPayload().getType();
} else if (ncSignalingMessage.getType() != null) {
type = ncSignalingMessage.getType();
}
String type = ncSignalingMessage.getType();
PeerConnectionWrapper peerConnectionWrapper = null;