diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt index 7c7078821..7da999bcc 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt +++ b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt @@ -2603,7 +2603,7 @@ class ChatController(args: Bundle) : } override fun onNext(t: ChatOverallSingleMessage) { - if (t.ocs.meta!!.statusCode == HttpURLConnection.HTTP_ACCEPTED) { + if (t.ocs!!.meta!!.statusCode == HttpURLConnection.HTTP_ACCEPTED) { Toast.makeText( context, R.string.nc_delete_message_leaked_to_matterbridge, Toast.LENGTH_LONG diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessage.kt b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessage.kt index 6ac29b57b..e06011a11 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessage.kt +++ b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessage.kt @@ -3,6 +3,10 @@ * * @author Mario Danic * @author Tim Krüger + * @author Marcel Hibbe + * @author Andy Scherzinger + * Copyright (C) 2022 Andy Scherzinger + * Copyright (C) 2022 Marcel Hibbe * Copyright (C) 2021 Tim Krüger * Copyright (C) 2017-2018 Mario Danic * diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCS.kt b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCS.kt index 6aed01a6d..d4b6f1bf5 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCS.kt +++ b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCS.kt @@ -2,6 +2,8 @@ * 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 diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCSSingleMessage.kt b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCSSingleMessage.kt index e7ff0203c..49a6194f0 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCSSingleMessage.kt +++ b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCSSingleMessage.kt @@ -2,6 +2,8 @@ * Nextcloud Talk application * * @author Marcel Hibbe + * @author Andy Scherzinger + * Copyright (C) 2022 Andy Scherzinger * Copyright (C) 2021 Marcel Hibbe * * This program is free software: you can redistribute it and/or modify diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverall.java deleted file mode 100644 index ce1cdfd4f..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverall.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Mario Danic - * 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.chat; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; - -import org.parceler.Parcel; - -@Parcel -@JsonObject -public class ChatOverall { - @JsonField(name = "ocs") - public ChatOCS ocs; - - public ChatOCS getOcs() { - return this.ocs; - } - - public void setOcs(ChatOCS ocs) { - this.ocs = ocs; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof ChatOverall)) { - return false; - } - final ChatOverall other = (ChatOverall) 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 ChatOverall; - } - - 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 "ChatOverall(ocs=" + this.getOcs() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverall.kt b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverall.kt new file mode 100644 index 000000000..60820b444 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverall.kt @@ -0,0 +1,37 @@ +/* + * 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.chat + +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 ChatOverall( + @JsonField(name = ["ocs"]) + var ocs: ChatOCS? = null +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null) +} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverallSingleMessage.java b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverallSingleMessage.java deleted file mode 100644 index ed2e04523..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverallSingleMessage.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Marcel Hibbe - * Copyright (C) 2021 Marcel Hibbe - * - * 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.chat; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; - -import org.parceler.Parcel; - -@Parcel -@JsonObject -public class ChatOverallSingleMessage { - @JsonField(name = "ocs") - public ChatOCSSingleMessage ocs; - - public ChatOCSSingleMessage getOcs() { - return this.ocs; - } - - public void setOcs(ChatOCSSingleMessage ocs) { - this.ocs = ocs; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof ChatOverallSingleMessage)) { - return false; - } - final ChatOverallSingleMessage other = (ChatOverallSingleMessage) 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 ChatOverallSingleMessage; - } - - 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 "ChatOverallSingleMessage(ocs=" + this.getOcs() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverallSingleMessage.kt b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverallSingleMessage.kt new file mode 100644 index 000000000..e182adf5c --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverallSingleMessage.kt @@ -0,0 +1,37 @@ +/* + * Nextcloud Talk application + * + * @author Marcel Hibbe + * @author Andy Scherzinger + * Copyright (C) 2022 Andy Scherzinger + * Copyright (C) 2021 Marcel Hibbe + * + * 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.chat + +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 ChatOverallSingleMessage( + @JsonField(name = ["ocs"]) + var ocs: ChatOCSSingleMessage? = null +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null) +} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOCS.java deleted file mode 100644 index 6f0191037..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOCS.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Mario Danic - * 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.chat; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.models.json.generic.GenericOCS; - -import org.parceler.Parcel; - -import java.util.HashMap; -import java.util.Objects; - -@Parcel -@JsonObject -public class ChatShareOCS { - @JsonField(name = "data") - public HashMap data; - - public HashMap getData() { - return this.data; - } - - public void setData(HashMap data) { - this.data = data; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof ChatShareOCS)) { - return false; - } - final ChatShareOCS other = (ChatShareOCS) o; - if (!other.canEqual(this)) { - return false; - } - final Object this$data = this.getData(); - final Object other$data = other.getData(); - - return Objects.equals(this$data, other$data); - } - - protected boolean canEqual(final Object other) { - return other instanceof ChatShareOCS; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $data = this.getData(); - return result * PRIME + ($data == null ? 43 : $data.hashCode()); - } - - public String toString() { - return "ChatShareOCS(data=" + this.getData() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOCS.kt b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOCS.kt new file mode 100644 index 000000000..d84b37f7c --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOCS.kt @@ -0,0 +1,38 @@ +/* + * Nextcloud Talk application + * + * @author Andy Scherzinger + * @author Tim Krüger + * Copyright (C) 2022 Andy Scherzinger + * Copyright (C) 2022 Tim Krüger + * + * 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.chat + +import android.os.Parcelable +import com.bluelinelabs.logansquare.annotation.JsonField +import com.bluelinelabs.logansquare.annotation.JsonObject +import java.util.HashMap +import kotlinx.android.parcel.Parcelize + +@Parcelize +@JsonObject +data class ChatShareOCS( + @JsonField(name = ["data"]) + var data: HashMap? = null +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null) +} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverall.java deleted file mode 100644 index ce97b53e6..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverall.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Mario Danic - * 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.chat; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; - -import org.parceler.Parcel; - -import java.util.Objects; - -@Parcel -@JsonObject -public class ChatShareOverall { - @JsonField(name = "ocs") - public ChatShareOCS ocs; - - public ChatShareOCS getOcs() { - return this.ocs; - } - - public void setOcs(ChatShareOCS ocs) { - this.ocs = ocs; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof ChatShareOverall)) { - return false; - } - final ChatShareOverall other = (ChatShareOverall) o; - if (!other.canEqual(this)) { - return false; - } - final Object this$ocs = this.getOcs(); - final Object other$ocs = other.getOcs(); - - return Objects.equals(this$ocs, other$ocs); - } - - protected boolean canEqual(final Object other) { - return other instanceof ChatShareOverall; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $ocs = this.getOcs(); - return result * PRIME + ($ocs == null ? 43 : $ocs.hashCode()); - } - - public String toString() { - return "ChatShareOverall(ocs=" + this.getOcs() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverall.kt b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverall.kt new file mode 100644 index 000000000..a5acce78a --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverall.kt @@ -0,0 +1,37 @@ +/* + * Nextcloud Talk application + * + * @author Andy Scherzinger + * @author Tim Krüger + * Copyright (C) 2022 Andy Scherzinger + * Copyright (C) 2022 Tim Krüger + * + * 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.chat + +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 ChatShareOverall( + @JsonField(name = ["ocs"]) + var ocs: ChatShareOCS? = null +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null) +} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOCS.java deleted file mode 100644 index c6ae81b62..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOCS.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Mario Danic - * 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.chat; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; - -import org.parceler.Parcel; - -import java.util.HashMap; -import java.util.List; -import java.util.Objects; - -import androidx.annotation.NonNull; - -@Parcel -@JsonObject -public class ChatShareOverviewOCS { - @JsonField(name = "data") - public HashMap> data; - - public HashMap> getData() { - return this.data; - } - - public void setData(HashMap> data) { - this.data = data; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof ChatShareOverviewOCS)) { - return false; - } - final ChatShareOverviewOCS other = (ChatShareOverviewOCS) o; - if (!other.canEqual(this)) { - return false; - } - final Object this$data = this.getData(); - final Object other$data = other.getData(); - - return Objects.equals(this$data, other$data); - } - - protected boolean canEqual(final Object other) { - return other instanceof ChatShareOverviewOCS; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $data = this.getData(); - return result * PRIME + ($data == null ? 43 : $data.hashCode()); - } - - public String toString() { - return "ChatShareOverviewOCS(data=" + this.getData() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOCS.kt b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOCS.kt new file mode 100644 index 000000000..68d1da2a3 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOCS.kt @@ -0,0 +1,41 @@ +/* + * Nextcloud Talk application + * + * @author Andy Scherzinger + * @author Tim Krüger + * Copyright (C) 2022 Andy Scherzinger + * Copyright (C) 2022 Tim Krüger + * + * 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.chat + +import android.os.Parcelable +import com.bluelinelabs.logansquare.annotation.JsonField +import com.bluelinelabs.logansquare.annotation.JsonObject +import com.nextcloud.talk.models.json.AnyParceler +import kotlinx.android.parcel.Parcelize +import kotlinx.android.parcel.TypeParceler +import java.util.HashMap + +@Parcelize +@JsonObject +@TypeParceler +data class ChatShareOverviewOCS( + @JsonField(name = ["data"]) + var data: HashMap>? = null +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null) +} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOverall.java deleted file mode 100644 index 086a765d7..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOverall.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Mario Danic - * 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.chat; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; - -import org.parceler.Parcel; - -import java.util.Objects; - -@Parcel -@JsonObject -public class ChatShareOverviewOverall { - @JsonField(name = "ocs") - public ChatShareOverviewOCS ocs; - - public ChatShareOverviewOCS getOcs() { - return this.ocs; - } - - public void setOcs(ChatShareOverviewOCS ocs) { - this.ocs = ocs; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof ChatShareOverviewOverall)) { - return false; - } - final ChatShareOverviewOverall other = (ChatShareOverviewOverall) o; - if (!other.canEqual(this)) { - return false; - } - final Object this$ocs = this.getOcs(); - final Object other$ocs = other.getOcs(); - - return Objects.equals(this$ocs, other$ocs); - } - - protected boolean canEqual(final Object other) { - return other instanceof ChatShareOverviewOverall; - } - - public int hashCode() { - final int PRIME = 59; - int result = 1; - final Object $ocs = this.getOcs(); - return result * PRIME + ($ocs == null ? 43 : $ocs.hashCode()); - } - - public String toString() { - return "ChatShareOverviewOverall(ocs=" + this.getOcs() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOverall.kt b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOverall.kt new file mode 100644 index 000000000..7cfe04d82 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOverall.kt @@ -0,0 +1,37 @@ +/* + * Nextcloud Talk application + * + * @author Andy Scherzinger + * @author Tim Krüger + * Copyright (C) 2022 Andy Scherzinger + * Copyright (C) 2022 Tim Krüger + * + * 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.chat + +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 ChatShareOverviewOverall( + @JsonField(name = ["ocs"]) + var ocs: ChatShareOverviewOCS? = null +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null) +} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/chat/ReadStatus.java b/app/src/main/java/com/nextcloud/talk/models/json/chat/ReadStatus.kt similarity index 91% rename from app/src/main/java/com/nextcloud/talk/models/json/chat/ReadStatus.java rename to app/src/main/java/com/nextcloud/talk/models/json/chat/ReadStatus.kt index 03442f3d1..eca46fd47 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/chat/ReadStatus.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/chat/ReadStatus.kt @@ -17,9 +17,8 @@ * 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.chat -package com.nextcloud.talk.models.json.chat; - -public enum ReadStatus { +enum class ReadStatus { NONE, SENT, READ } diff --git a/app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.kt b/app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.kt index 70120287e..b230a35b1 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.kt +++ b/app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.kt @@ -1,24 +1,25 @@ /* + * Nextcloud Talk application * - * Nextcloud Talk application + * @author Mario Danic + * @author Tim Krüger + * @author Andy Scherzinger + * Copyright (C) 2022 Andy Scherzinger + * Copyright (C) 2021 Tim Krüger + * Copyright (C) 2017 Mario Danic (mario@lovelyhq.com) * - * @author Mario Danic - * @author Tim Krüger - * Copyright (C) 2021 Tim Krüger - * 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 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. * - * 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 . + * 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.conversations diff --git a/app/src/main/java/com/nextcloud/talk/viewmodels/SharedItemsViewModel.kt b/app/src/main/java/com/nextcloud/talk/viewmodels/SharedItemsViewModel.kt index 7f4fa5a26..03210d6cf 100644 --- a/app/src/main/java/com/nextcloud/talk/viewmodels/SharedItemsViewModel.kt +++ b/app/src/main/java/com/nextcloud/talk/viewmodels/SharedItemsViewModel.kt @@ -140,7 +140,7 @@ class SharedItemsViewModel(private val repository: SharedItemsRepository, privat override fun onSubscribe(d: Disposable) = Unit override fun onNext(response: Response) { - val typeMap = response.body()!!.ocs!!.data + val typeMap = response.body()!!.ocs!!.data!! for (it in typeMap) { if (it.value.size > 0) { try {