From 0bcc219d481c117e2e6afff34f9139191101f9a2 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Tue, 17 May 2022 22:27:13 +0200 Subject: [PATCH] Migrate signaling settings Signed-off-by: Andy Scherzinger --- .../talk/models/json/generic/GenericMeta.kt | 2 +- .../json/signaling/settings/IceServer.java | 129 ------------------ .../json/signaling/settings/IceServer.kt | 44 ++++++ .../json/signaling/settings/Settings.java | 127 ----------------- .../json/signaling/settings/Settings.kt | 43 ++++++ .../settings/SignalingSettingsOcs.java | 72 ---------- .../settings/SignalingSettingsOcs.kt | 40 ++++++ .../settings/SignalingSettingsOverall.java | 71 ---------- .../settings/SignalingSettingsOverall.kt | 37 +++++ 9 files changed, 165 insertions(+), 400 deletions(-) delete mode 100644 app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.java create mode 100644 app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.kt delete mode 100644 app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.java create mode 100644 app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.kt delete mode 100644 app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOcs.java create mode 100644 app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOcs.kt delete mode 100644 app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOverall.java create mode 100644 app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOverall.kt diff --git a/app/src/main/java/com/nextcloud/talk/models/json/generic/GenericMeta.kt b/app/src/main/java/com/nextcloud/talk/models/json/generic/GenericMeta.kt index 8ec5c0f9e..d5d6824c4 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/generic/GenericMeta.kt +++ b/app/src/main/java/com/nextcloud/talk/models/json/generic/GenericMeta.kt @@ -4,7 +4,7 @@ * @author Mario Danic * @author Andy Scherzinger * Copyright (C) 2022 Andy Scherzinger - * Copyright (C) 2017 Mario Danic (mario@lovelyhq.com) + * 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 diff --git a/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.java deleted file mode 100644 index 1df8eaa40..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 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.models.json.signaling.settings; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; - -import java.util.List; - -@JsonObject -public class IceServer { - @Deprecated - @JsonField(name = "url") - String url; - - @JsonField(name = "urls") - List urls; - - @JsonField(name = "username") - String username; - - @JsonField(name = "credential") - String credential; - - @Deprecated - public String getUrl() { - return this.url; - } - - public List getUrls() { - return this.urls; - } - - public String getUsername() { - return this.username; - } - - public String getCredential() { - return this.credential; - } - - public void setUrl(String url) { - this.url = url; - } - - public void setUrls(List urls) { - this.urls = urls; - } - - public void setUsername(String username) { - this.username = username; - } - - public void setCredential(String credential) { - this.credential = credential; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof IceServer)) { - return false; - } - final IceServer other = (IceServer) o; - if (!other.canEqual((Object) this)) { - return false; - } - final Object this$url = this.getUrl(); - final Object other$url = other.getUrl(); - if (this$url == null ? other$url != null : !this$url.equals(other$url)) { - return false; - } - final Object this$urls = this.getUrls(); - final Object other$urls = other.getUrls(); - if (this$urls == null ? other$urls != null : !this$urls.equals(other$urls)) { - return false; - } - final Object this$username = this.getUsername(); - final Object other$username = other.getUsername(); - if (this$username == null ? other$username != null : !this$username.equals(other$username)) { - return false; - } - final Object this$credential = this.getCredential(); - final Object other$credential = other.getCredential(); - - return this$credential == null ? other$credential == null : this$credential.equals(other$credential); - } - - protected boolean canEqual(final Object other) { - return other instanceof IceServer; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $url = this.getUrl(); - result = result * PRIME + ($url == null ? 43 : $url.hashCode()); - final Object $urls = this.getUrls(); - result = result * PRIME + ($urls == null ? 43 : $urls.hashCode()); - final Object $username = this.getUsername(); - result = result * PRIME + ($username == null ? 43 : $username.hashCode()); - final Object $credential = this.getCredential(); - result = result * PRIME + ($credential == null ? 43 : $credential.hashCode()); - return result; - } - - public String toString() { - return "IceServer(url=" + this.getUrl() + ", urls=" + this.getUrls() + ", username=" + this.getUsername() + ", credential=" + this.getCredential() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.kt b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.kt new file mode 100644 index 000000000..85a4efbc9 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.kt @@ -0,0 +1,44 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * @author Andy Scherzinger + * Copyright (C) 2022 Andy Scherzinger + * 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.models.json.signaling.settings + +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 IceServer( + @Deprecated("") + @JsonField(name = ["url"]) + var url: String? = null, + @JsonField(name = ["urls"]) + var urls: List? = null, + @JsonField(name = ["username"]) + var username: String? = null, + @JsonField(name = ["credential"]) + var credential: String? = null +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null, null, null) +} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.java deleted file mode 100644 index 985217601..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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.models.json.signaling.settings; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; - -import java.util.List; - -@JsonObject -public class Settings { - @JsonField(name = "stunservers") - List stunServers; - - @JsonField(name = "turnservers") - List turnServers; - - @JsonField(name = "server") - String externalSignalingServer; - - @JsonField(name = "ticket") - String externalSignalingTicket; - - public List getStunServers() { - return this.stunServers; - } - - public List getTurnServers() { - return this.turnServers; - } - - public String getExternalSignalingServer() { - return this.externalSignalingServer; - } - - public String getExternalSignalingTicket() { - return this.externalSignalingTicket; - } - - public void setStunServers(List stunServers) { - this.stunServers = stunServers; - } - - public void setTurnServers(List turnServers) { - this.turnServers = turnServers; - } - - public void setExternalSignalingServer(String externalSignalingServer) { - this.externalSignalingServer = externalSignalingServer; - } - - public void setExternalSignalingTicket(String externalSignalingTicket) { - this.externalSignalingTicket = externalSignalingTicket; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof Settings)) { - return false; - } - final Settings other = (Settings) o; - if (!other.canEqual((Object) this)) { - return false; - } - final Object this$stunServers = this.getStunServers(); - final Object other$stunServers = other.getStunServers(); - if (this$stunServers == null ? other$stunServers != null : !this$stunServers.equals(other$stunServers)) { - return false; - } - final Object this$turnServers = this.getTurnServers(); - final Object other$turnServers = other.getTurnServers(); - if (this$turnServers == null ? other$turnServers != null : !this$turnServers.equals(other$turnServers)) { - return false; - } - final Object this$externalSignalingServer = this.getExternalSignalingServer(); - final Object other$externalSignalingServer = other.getExternalSignalingServer(); - if (this$externalSignalingServer == null ? other$externalSignalingServer != null : !this$externalSignalingServer.equals(other$externalSignalingServer)) { - return false; - } - final Object this$externalSignalingTicket = this.getExternalSignalingTicket(); - final Object other$externalSignalingTicket = other.getExternalSignalingTicket(); - - return this$externalSignalingTicket == null ? other$externalSignalingTicket == null : this$externalSignalingTicket.equals(other$externalSignalingTicket); - } - - protected boolean canEqual(final Object other) { - return other instanceof Settings; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $stunServers = this.getStunServers(); - result = result * PRIME + ($stunServers == null ? 43 : $stunServers.hashCode()); - final Object $turnServers = this.getTurnServers(); - result = result * PRIME + ($turnServers == null ? 43 : $turnServers.hashCode()); - final Object $externalSignalingServer = this.getExternalSignalingServer(); - result = result * PRIME + ($externalSignalingServer == null ? 43 : $externalSignalingServer.hashCode()); - final Object $externalSignalingTicket = this.getExternalSignalingTicket(); - result = result * PRIME + ($externalSignalingTicket == null ? 43 : $externalSignalingTicket.hashCode()); - return result; - } - - public String toString() { - return "Settings(stunServers=" + this.getStunServers() + ", turnServers=" + this.getTurnServers() + ", externalSignalingServer=" + this.getExternalSignalingServer() + ", externalSignalingTicket=" + this.getExternalSignalingTicket() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.kt b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.kt new file mode 100644 index 000000000..f04b3095c --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.kt @@ -0,0 +1,43 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * @author Andy Scherzinger + * Copyright (C) 2022 Andy Scherzinger + * 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.models.json.signaling.settings + +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 Settings( + @JsonField(name = ["stunservers"]) + var stunServers: List? = null, + @JsonField(name = ["turnservers"]) + var turnServers: List? = null, + @JsonField(name = ["server"]) + var externalSignalingServer: String? = null, + @JsonField(name = ["ticket"]) + var externalSignalingTicket: String? = null +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null, null, null) +} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOcs.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOcs.java deleted file mode 100644 index 477438485..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOcs.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.models.json.signaling.settings; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.models.json.generic.GenericOCS; - -@JsonObject -public class SignalingSettingsOcs extends GenericOCS { - @JsonField(name = "data") - Settings settings; - - public Settings getSettings() { - return this.settings; - } - - public void setSettings(Settings settings) { - this.settings = settings; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof SignalingSettingsOcs)) { - return false; - } - final SignalingSettingsOcs other = (SignalingSettingsOcs) o; - if (!other.canEqual((Object) this)) { - return false; - } - final Object this$settings = this.getSettings(); - final Object other$settings = other.getSettings(); - - return this$settings == null ? other$settings == null : this$settings.equals(other$settings); - } - - protected boolean canEqual(final Object other) { - return other instanceof SignalingSettingsOcs; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $settings = this.getSettings(); - result = result * PRIME + ($settings == null ? 43 : $settings.hashCode()); - return result; - } - - public String toString() { - return "SignalingSettingsOcs(settings=" + this.getSettings() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOcs.kt b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOcs.kt new file mode 100644 index 000000000..473b8a57c --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOcs.kt @@ -0,0 +1,40 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * @author Andy Scherzinger + * Copyright (C) 2022 Andy Scherzinger + * 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.models.json.signaling.settings + +import android.os.Parcelable +import com.bluelinelabs.logansquare.annotation.JsonField +import com.bluelinelabs.logansquare.annotation.JsonObject +import com.nextcloud.talk.models.json.generic.GenericMeta +import kotlinx.android.parcel.Parcelize + +@Parcelize +@JsonObject +data class SignalingSettingsOcs( + @JsonField(name = ["meta"]) + var meta: GenericMeta?, + @JsonField(name = ["data"]) + var settings: Settings? = 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/signaling/settings/SignalingSettingsOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOverall.java deleted file mode 100644 index 17420876b..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOverall.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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.models.json.signaling.settings; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; - -@JsonObject -public class SignalingSettingsOverall { - @JsonField(name = "ocs") - SignalingSettingsOcs ocs; - - public SignalingSettingsOcs getOcs() { - return this.ocs; - } - - public void setOcs(SignalingSettingsOcs ocs) { - this.ocs = ocs; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof SignalingSettingsOverall)) { - return false; - } - final SignalingSettingsOverall other = (SignalingSettingsOverall) o; - if (!other.canEqual((Object) this)) { - return false; - } - final Object this$ocs = this.getOcs(); - final Object other$ocs = other.getOcs(); - - return this$ocs == null ? other$ocs == null : this$ocs.equals(other$ocs); - } - - protected boolean canEqual(final Object other) { - return other instanceof SignalingSettingsOverall; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $ocs = this.getOcs(); - result = result * PRIME + ($ocs == null ? 43 : $ocs.hashCode()); - return result; - } - - public String toString() { - return "SignalingSettingsOverall(ocs=" + this.getOcs() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOverall.kt b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOverall.kt new file mode 100644 index 000000000..3fc736aaf --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOverall.kt @@ -0,0 +1,37 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * @author Andy Scherzinger + * Copyright (C) 2022 Andy Scherzinger + * 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.models.json.signaling.settings + +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 SignalingSettingsOverall( + @JsonField(name = ["ocs"]) + var ocs: SignalingSettingsOcs? = null +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null) +}