diff --git a/app/src/main/java/com/nextcloud/talk/models/json/websocket/RequestOfferOverallWebSocketMessage.kt b/app/src/main/java/com/nextcloud/talk/models/json/websocket/RequestOfferOverallWebSocketMessage.kt deleted file mode 100644 index deb11af47..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/websocket/RequestOfferOverallWebSocketMessage.kt +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Mario Danic - * @author Andy Scherzinger - * Copyright (C) 2022 Andy Scherzinger - * Copyright (C) 2017-2018 Mario Danic - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.nextcloud.talk.models.json.websocket - -import android.os.Parcelable -import com.bluelinelabs.logansquare.annotation.JsonField -import com.bluelinelabs.logansquare.annotation.JsonObject -import kotlinx.android.parcel.Parcelize - -@Parcelize -@JsonObject -data class RequestOfferOverallWebSocketMessage( - @JsonField(name = ["type"]) - var type: String? = null, - @JsonField(name = ["message"]) - var requestOfferOverallWebSocketMessage: RequestOfferSignalingMessage? = null -) : Parcelable { - // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' - constructor() : this(null, null) -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/websocket/RequestOfferSignalingMessage.kt b/app/src/main/java/com/nextcloud/talk/models/json/websocket/RequestOfferSignalingMessage.kt deleted file mode 100644 index d791cf7bd..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/websocket/RequestOfferSignalingMessage.kt +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Mario Danic - * @author Andy Scherzinger - * Copyright (C) 2022 Andy Scherzinger - * Copyright (C) 2017-2018 Mario Danic - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.nextcloud.talk.models.json.websocket - -import android.os.Parcelable -import com.bluelinelabs.logansquare.annotation.JsonField -import com.bluelinelabs.logansquare.annotation.JsonObject -import kotlinx.android.parcel.Parcelize - -@Parcelize -@JsonObject -class RequestOfferSignalingMessage( - @JsonField(name = ["recipient"]) - var actorWebSocketMessage: ActorWebSocketMessage? = null, - @JsonField(name = ["data"]) - var signalingDataWebSocketMessageForOffer: SignalingDataWebSocketMessageForOffer? = null -) : Parcelable { - // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' - constructor() : this(null, null) -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/websocket/SignalingDataWebSocketMessageForOffer.kt b/app/src/main/java/com/nextcloud/talk/models/json/websocket/SignalingDataWebSocketMessageForOffer.kt deleted file mode 100644 index dbf2327fc..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/websocket/SignalingDataWebSocketMessageForOffer.kt +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Mario Danic - * @author Andy Scherzinger - * Copyright (C) 2022 Andy Scherzinger - * Copyright (C) 2017-2018 Mario Danic - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.nextcloud.talk.models.json.websocket - -import android.os.Parcelable -import com.bluelinelabs.logansquare.annotation.JsonField -import com.bluelinelabs.logansquare.annotation.JsonObject -import kotlinx.android.parcel.Parcelize - -@Parcelize -@JsonObject -class SignalingDataWebSocketMessageForOffer( - @JsonField(name = ["type"]) - var type: String? = null, - @JsonField(name = ["roomType"]) - var roomType: String? = null -) : Parcelable { - // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' - constructor() : this(null, null) -} 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 e6ee105dc..41066e541 100644 --- a/app/src/main/java/com/nextcloud/talk/webrtc/WebSocketConnectionHelper.java +++ b/app/src/main/java/com/nextcloud/talk/webrtc/WebSocketConnectionHelper.java @@ -33,11 +33,8 @@ 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.RequestOfferOverallWebSocketMessage; -import com.nextcloud.talk.models.json.websocket.RequestOfferSignalingMessage; import com.nextcloud.talk.models.json.websocket.RoomOverallWebSocketMessage; import com.nextcloud.talk.models.json.websocket.RoomWebSocketMessage; -import com.nextcloud.talk.models.json.websocket.SignalingDataWebSocketMessageForOffer; import com.nextcloud.talk.utils.ApiUtils; import java.util.HashMap; @@ -146,24 +143,15 @@ public class WebSocketConnectionHelper { return roomOverallWebSocketMessage; } - RequestOfferOverallWebSocketMessage getAssembledRequestOfferModel(String sessionId, String roomType) { - RequestOfferOverallWebSocketMessage requestOfferOverallWebSocketMessage = new RequestOfferOverallWebSocketMessage(); - requestOfferOverallWebSocketMessage.setType("message"); + CallOverallWebSocketMessage getAssembledRequestOfferModel(String sessionId, String roomType) { + NCSignalingMessage ncSignalingMessage = new NCSignalingMessage(); + // "to" property is not actually needed in the "requestoffer" signaling message, but it is used to set the + // recipient session ID in the assembled call message. + ncSignalingMessage.setTo(sessionId); + ncSignalingMessage.setRoomType(roomType); + ncSignalingMessage.setType("requestoffer"); - RequestOfferSignalingMessage requestOfferSignalingMessage = new RequestOfferSignalingMessage(); - - ActorWebSocketMessage actorWebSocketMessage = new ActorWebSocketMessage(); - actorWebSocketMessage.setType("session"); - actorWebSocketMessage.setSessionId(sessionId); - requestOfferSignalingMessage.setActorWebSocketMessage(actorWebSocketMessage); - - SignalingDataWebSocketMessageForOffer signalingDataWebSocketMessageForOffer = new SignalingDataWebSocketMessageForOffer(); - signalingDataWebSocketMessageForOffer.setRoomType(roomType); - signalingDataWebSocketMessageForOffer.setType("requestoffer"); - requestOfferSignalingMessage.setSignalingDataWebSocketMessageForOffer(signalingDataWebSocketMessageForOffer); - - requestOfferOverallWebSocketMessage.setRequestOfferOverallWebSocketMessage(requestOfferSignalingMessage); - return requestOfferOverallWebSocketMessage; + return getAssembledCallMessageModel(ncSignalingMessage); } CallOverallWebSocketMessage getAssembledCallMessageModel(NCSignalingMessage ncSignalingMessage) {