diff --git a/app/src/main/java/com/nextcloud/talk/controllers/CallController.java b/app/src/main/java/com/nextcloud/talk/controllers/CallController.java index 681e69862..538ffb330 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/CallController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/CallController.java @@ -1642,7 +1642,6 @@ public class CallController extends BaseController { ncMessageWrapper.setSessionId(callSession); NCSignalingMessage ncSignalingMessage = new NCSignalingMessage(); ncSignalingMessage.setTo(sessionDescriptionSend.getPeerId()); - ncSignalingMessage.setFrom(callSession); ncSignalingMessage.setRoomType("video"); ncSignalingMessage.setType(sessionDescriptionSend.getType()); NCMessagePayload ncMessagePayload = new NCMessagePayload(); diff --git a/app/src/main/java/com/nextcloud/talk/models/json/websocket/RecipientWebSocketMessage.java b/app/src/main/java/com/nextcloud/talk/models/json/websocket/ActorWebSocketMessage.java similarity index 96% rename from app/src/main/java/com/nextcloud/talk/models/json/websocket/RecipientWebSocketMessage.java rename to app/src/main/java/com/nextcloud/talk/models/json/websocket/ActorWebSocketMessage.java index 50c6e5e5a..6cd1050b6 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/websocket/RecipientWebSocketMessage.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/websocket/ActorWebSocketMessage.java @@ -30,7 +30,7 @@ import lombok.Data; @Data @JsonObject @Parcel -public class RecipientWebSocketMessage { +public class ActorWebSocketMessage { @JsonField(name = "type") String type; diff --git a/app/src/main/java/com/nextcloud/talk/models/json/websocket/CallWebSocketMessage.java b/app/src/main/java/com/nextcloud/talk/models/json/websocket/CallWebSocketMessage.java index 1c04e8e78..244c360e4 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/websocket/CallWebSocketMessage.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/websocket/CallWebSocketMessage.java @@ -22,7 +22,6 @@ package com.nextcloud.talk.models.json.websocket; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.models.json.signaling.NCMessageWrapper; import com.nextcloud.talk.models.json.signaling.NCSignalingMessage; import org.parceler.Parcel; @@ -34,7 +33,10 @@ import lombok.Data; @Parcel public class CallWebSocketMessage { @JsonField(name = "recipient") - RecipientWebSocketMessage recipientWebSocketMessage; + ActorWebSocketMessage actorWebSocketMessage; + + @JsonField(name = "sender") + ActorWebSocketMessage senderWebSocketMessage; @JsonField(name = "data") NCSignalingMessage ncSignalingMessage; diff --git a/app/src/main/java/com/nextcloud/talk/models/json/websocket/RequestOfferSignalingMessage.java b/app/src/main/java/com/nextcloud/talk/models/json/websocket/RequestOfferSignalingMessage.java index 58c96d0ec..3395f64eb 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/websocket/RequestOfferSignalingMessage.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/websocket/RequestOfferSignalingMessage.java @@ -32,7 +32,7 @@ import lombok.Data; @Parcel public class RequestOfferSignalingMessage { @JsonField(name = "recipient") - RecipientWebSocketMessage recipientWebSocketMessage; + ActorWebSocketMessage actorWebSocketMessage; @JsonField(name = "data") SignalingDataWebSocketMessageForOffer signalingDataWebSocketMessageForOffer; diff --git a/app/src/main/java/com/nextcloud/talk/webrtc/WebSocketConnectionHelper.java b/app/src/main/java/com/nextcloud/talk/webrtc/WebSocketConnectionHelper.java index 68e9f824b..f3ac9c5cf 100644 --- a/app/src/main/java/com/nextcloud/talk/webrtc/WebSocketConnectionHelper.java +++ b/app/src/main/java/com/nextcloud/talk/webrtc/WebSocketConnectionHelper.java @@ -23,13 +23,13 @@ package com.nextcloud.talk.webrtc; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.models.database.UserEntity; import com.nextcloud.talk.models.json.signaling.NCMessageWrapper; +import com.nextcloud.talk.models.json.websocket.ActorWebSocketMessage; import com.nextcloud.talk.models.json.websocket.AuthParametersWebSocketMessage; import com.nextcloud.talk.models.json.websocket.AuthWebSocketMessage; import com.nextcloud.talk.models.json.websocket.CallOverallWebSocketMessage; import com.nextcloud.talk.models.json.websocket.CallWebSocketMessage; import com.nextcloud.talk.models.json.websocket.HelloOverallWebSocketMessage; import com.nextcloud.talk.models.json.websocket.HelloWebSocketMessage; -import com.nextcloud.talk.models.json.websocket.RecipientWebSocketMessage; import com.nextcloud.talk.models.json.websocket.RequestOfferOverallWebSocketMessage; import com.nextcloud.talk.models.json.websocket.RequestOfferSignalingMessage; import com.nextcloud.talk.models.json.websocket.RoomOverallWebSocketMessage; @@ -44,8 +44,6 @@ import javax.inject.Inject; import autodagger.AutoInjector; import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.WebSocket; @AutoInjector(NextcloudTalkApplication.class) public class WebSocketConnectionHelper { @@ -125,10 +123,10 @@ public class WebSocketConnectionHelper { RequestOfferSignalingMessage requestOfferSignalingMessage = new RequestOfferSignalingMessage(); - RecipientWebSocketMessage recipientWebSocketMessage = new RecipientWebSocketMessage(); - recipientWebSocketMessage.setType("session"); - recipientWebSocketMessage.setSessionId(sessionId); - requestOfferSignalingMessage.setRecipientWebSocketMessage(recipientWebSocketMessage); + ActorWebSocketMessage actorWebSocketMessage = new ActorWebSocketMessage(); + actorWebSocketMessage.setType("session"); + actorWebSocketMessage.setSessionId(sessionId); + requestOfferSignalingMessage.setActorWebSocketMessage(actorWebSocketMessage); SignalingDataWebSocketMessageForOffer signalingDataWebSocketMessageForOffer = new SignalingDataWebSocketMessageForOffer(); signalingDataWebSocketMessageForOffer.setRoomType(roomType); @@ -145,10 +143,10 @@ public class WebSocketConnectionHelper { CallWebSocketMessage callWebSocketMessage = new CallWebSocketMessage(); - RecipientWebSocketMessage recipientWebSocketMessage = new RecipientWebSocketMessage(); - recipientWebSocketMessage.setType("session"); - recipientWebSocketMessage.setSessionId(ncMessageWrapper.getSignalingMessage().getTo()); - callWebSocketMessage.setRecipientWebSocketMessage(recipientWebSocketMessage); + ActorWebSocketMessage actorWebSocketMessage = new ActorWebSocketMessage(); + actorWebSocketMessage.setType("session"); + actorWebSocketMessage.setSessionId(ncMessageWrapper.getSignalingMessage().getTo()); + callWebSocketMessage.setActorWebSocketMessage(actorWebSocketMessage); callWebSocketMessage.setNcSignalingMessage(ncMessageWrapper.getSignalingMessage()); callOverallWebSocketMessage.setCallWebSocketMessage(callWebSocketMessage);