Эх сурвалжийг харах

Some signaling stuff

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 7 жил өмнө
parent
commit
2946ce6c44

+ 2 - 1
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<Integer> pullSignalingMessages(@Header("Authorization") String authorization, @Url String url);
+    Observable<SignalingOverall> pullSignalingMessages(@Header("Authorization") String authorization, @Url String url);
 
      /*
         QueryMap items are as follows:

+ 3 - 0
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;
 }

+ 45 - 0
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 <mario@lovelyhq.com>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+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<String, Object> payload;
+    @JsonField(name = "roomType")
+    String roomType;
+}

+ 40 - 0
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 <mario@lovelyhq.com>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+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<Participant>
+    @JsonField(name = "data")
+    Object signalingMessage;
+}

+ 36 - 0
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 <mario@lovelyhq.com>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+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<Signaling> signalings;
+}

+ 34 - 0
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 <mario@lovelyhq.com>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+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;
+
+}