From 2946ce6c4445e1871ce18a8f0d72ad7c0a729c02 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Wed, 1 Nov 2017 16:34:46 +0100 Subject: [PATCH] Some signaling stuff Signed-off-by: Mario Danic --- .../java/com/nextcloud/talk/api/NcApi.java | 3 +- .../models/json/participants/Participant.java | 3 ++ .../json/signaling/NCSignalingMessage.java | 45 +++++++++++++++++++ .../api/models/json/signaling/Signaling.java | 40 +++++++++++++++++ .../models/json/signaling/SignalingOCS.java | 36 +++++++++++++++ .../json/signaling/SignalingOverall.java | 34 ++++++++++++++ 6 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCSignalingMessage.java create mode 100644 app/src/main/java/com/nextcloud/talk/api/models/json/signaling/Signaling.java create mode 100644 app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOCS.java create mode 100644 app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOverall.java diff --git a/app/src/main/java/com/nextcloud/talk/api/NcApi.java b/app/src/main/java/com/nextcloud/talk/api/NcApi.java index 54e3537e6..59d133004 100644 --- a/app/src/main/java/com/nextcloud/talk/api/NcApi.java +++ b/app/src/main/java/com/nextcloud/talk/api/NcApi.java @@ -28,6 +28,7 @@ import com.nextcloud.talk.api.models.json.push.PushRegistrationOverall; import com.nextcloud.talk.api.models.json.rooms.RoomOverall; import com.nextcloud.talk.api.models.json.rooms.RoomsOverall; import com.nextcloud.talk.api.models.json.sharees.ShareesOverall; +import com.nextcloud.talk.api.models.json.signaling.SignalingOverall; import com.nextcloud.talk.api.models.json.userprofile.UserProfileOverall; import java.util.Map; @@ -162,7 +163,7 @@ public interface NcApi { Server URL is: baseUrl + ocsApiVersion + spreedApiVersion + /signaling */ @GET - Observable pullSignalingMessages(@Header("Authorization") String authorization, @Url String url); + Observable pullSignalingMessages(@Header("Authorization") String authorization, @Url String url); /* QueryMap items are as follows: diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/participants/Participant.java b/app/src/main/java/com/nextcloud/talk/api/models/json/participants/Participant.java index 244807fa0..030af8ee1 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/participants/Participant.java +++ b/app/src/main/java/com/nextcloud/talk/api/models/json/participants/Participant.java @@ -39,4 +39,7 @@ public class Participant { @JsonField(name = "sessionId") String sessionId; + + @JsonField(name = "roomId") + long roomId; } diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCSignalingMessage.java b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCSignalingMessage.java new file mode 100644 index 000000000..6b20fa419 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCSignalingMessage.java @@ -0,0 +1,45 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * Copyright (C) 2017 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.api.models.json.signaling; + +import com.bluelinelabs.logansquare.annotation.JsonField; +import com.bluelinelabs.logansquare.annotation.JsonObject; + +import java.util.HashMap; + +import lombok.Data; + +@Data +@JsonObject +public class NCSignalingMessage { + @JsonField(name = "from") + String from; + @JsonField(name = "to") + String to; + @JsonField(name = "sid") + String sid; + @JsonField(name = "type") + String type; + @JsonField(name = "payload") + HashMap payload; + @JsonField(name = "roomType") + String roomType; +} diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/Signaling.java b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/Signaling.java new file mode 100644 index 000000000..a78191f0c --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/Signaling.java @@ -0,0 +1,40 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * Copyright (C) 2017 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.api.models.json.signaling; + +import com.bluelinelabs.logansquare.annotation.JsonField; +import com.bluelinelabs.logansquare.annotation.JsonObject; + +import lombok.Data; + +/** + * Created by mdjanic on 30/10/2017. + */ + +@Data +@JsonObject +public class Signaling { + @JsonField(name = "type") + String type; + //can be NCSignalingMessage or List + @JsonField(name = "data") + Object signalingMessage; +} diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOCS.java b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOCS.java new file mode 100644 index 000000000..ced5207b6 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOCS.java @@ -0,0 +1,36 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * Copyright (C) 2017 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.api.models.json.signaling; + +import com.bluelinelabs.logansquare.annotation.JsonField; +import com.bluelinelabs.logansquare.annotation.JsonObject; +import com.nextcloud.talk.api.models.json.generic.GenericOCS; + +import java.util.List; + +import lombok.Data; + +@Data +@JsonObject +public class SignalingOCS extends GenericOCS { + @JsonField(name = "data") + List signalings; +} diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOverall.java b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOverall.java new file mode 100644 index 000000000..498797fc2 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOverall.java @@ -0,0 +1,34 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * Copyright (C) 2017 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.api.models.json.signaling; + +import com.bluelinelabs.logansquare.annotation.JsonField; +import com.bluelinelabs.logansquare.annotation.JsonObject; + +import lombok.Data; + +@JsonObject +@Data +public class SignalingOverall { + @JsonField(name = "ocs") + SignalingOCS ocs; + +}