Merge pull request #1834 from nextcloud/feature/1548/remove-parceler-part-2

Feature/1548/remove parceler part 2
This commit is contained in:
Andy Scherzinger 2022-02-28 17:20:36 +01:00 committed by GitHub
commit 7769a24b64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 540 additions and 1344 deletions

View File

@ -1,96 +0,0 @@
/*
*
* Nextcloud Talk application
*
* @author Tim Krüger
* Copyright (C) 2021 Tim Krüger <t@timkrueger.me>
*
* 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.models.json.hovercard;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.parceler.Parcel;
import java.util.List;
import java.util.Objects;
@Parcel
@JsonObject
public class HoverCard {
@JsonField(name = "userId")
public String userId;
@JsonField(name = "displayName")
public String displayName;
@JsonField(name = "actions")
public List<HoverCardAction> actions;
public String getUserId() {
return this.userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public List<HoverCardAction> getActions() {
return actions;
}
public void setActions(List<HoverCardAction> actions) {
this.actions = actions;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
HoverCard hoverCard = (HoverCard) o;
return Objects.equals(userId, hoverCard.userId) &&
Objects.equals(displayName, hoverCard.displayName) &&
Objects.equals(actions, hoverCard.actions);
}
@Override
public int hashCode() {
return Objects.hash(userId, displayName, actions);
}
@Override
public String toString() {
return "HoverCard{" +
"userId='" + userId + '\'' +
", displayName='" + displayName + '\'' +
", actions=" + actions +
'}';
}
}

View File

@ -0,0 +1,40 @@
/*
*
* Nextcloud Talk application
*
* @author Tim Krüger
* Copyright (C) 2021-2022 Tim Krüger <t@timkrueger.me>
*
* 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.models.json.hovercard
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 HoverCard(
@JsonField(name = ["userId"])
var userId: String?,
@JsonField(name = ["displayName"])
var displayName: String?,
@JsonField(name = ["actions"])
var actions: List<HoverCardAction>?
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null, null, null)
}

View File

@ -1,107 +0,0 @@
/*
*
* Nextcloud Talk application
*
* @author Tim Krüger
* Copyright (C) 2021 Tim Krüger <t@timkrueger.me>
*
* 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.models.json.hovercard;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.parceler.Parcel;
import java.util.Objects;
@Parcel
@JsonObject
public class HoverCardAction {
@JsonField(name = "title")
public String title;
@JsonField(name = "icon")
public String icon;
@JsonField(name = "hyperlink")
public String hyperlink;
@JsonField(name = "appId")
public String appId;
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public String getHyperlink() {
return hyperlink;
}
public void setHyperlink(String hyperlink) {
this.hyperlink = hyperlink;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
HoverCardAction that = (HoverCardAction) o;
return Objects.equals(title, that.title) &&
Objects.equals(icon, that.icon) &&
Objects.equals(hyperlink, that.hyperlink) &&
Objects.equals(appId, that.appId);
}
@Override
public int hashCode() {
return Objects.hash(title, icon, hyperlink, appId);
}
@Override
public String toString() {
return "HoverCardAction{" +
"title='" + title + '\'' +
", icon='" + icon + '\'' +
", hyper='" + hyperlink + '\'' +
", appId='" + appId + '\'' +
'}';
}
}

View File

@ -0,0 +1,42 @@
/*
*
* Nextcloud Talk application
*
* @author Tim Krüger
* Copyright (C) 2021-2022 Tim Krüger <t@timkrueger.me>
*
* 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.models.json.hovercard
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 HoverCardAction(
@JsonField(name = ["title"])
var title: String?,
@JsonField(name = ["icon"])
var icon: String?,
@JsonField(name = ["hyperlink"])
var hyperlink: String?,
@JsonField(name = ["appId"])
var appId: String?
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null, null, null, null)
}

View File

@ -1,69 +0,0 @@
/*
*
* Nextcloud Talk application
*
* @author Tim Krüger
* Copyright (C) 2021 Tim Krüger <t@timkrueger.me>
*
* 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.models.json.hovercard;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import com.nextcloud.talk.models.json.generic.GenericOCS;
import java.util.Objects;
@JsonObject
public class HoverCardOCS extends GenericOCS {
@JsonField(name = "data")
public HoverCard data;
public HoverCard getData() {
return this.data;
}
public void setData(HoverCard data) {
this.data = data;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}
HoverCardOCS that = (HoverCardOCS) o;
return Objects.equals(data, that.data);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), data);
}
@Override
public String toString() {
return "HoverCardOCS{" +
"data=" + data +
'}';
}
}

View File

@ -0,0 +1,34 @@
/*
*
* Nextcloud Talk application
*
* @author Tim Krüger
* Copyright (C) 2021-2022 Tim Krüger <t@timkrueger.me>
*
* 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.models.json.hovercard
import com.bluelinelabs.logansquare.annotation.JsonField
import com.bluelinelabs.logansquare.annotation.JsonObject
import com.nextcloud.talk.models.json.generic.GenericOCS
@JsonObject
data class HoverCardOCS(
@JsonField(name = ["data"])
var data: HoverCard?
) : GenericOCS() {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null)
}

View File

@ -1,64 +0,0 @@
/*
*
* Nextcloud Talk application
*
* @author Tim Krüger
* Copyright (C) 2021 Tim Krüger <t@timkrueger.me>
*
* 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.models.json.hovercard;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import java.util.Objects;
@JsonObject
public class HoverCardOverall {
@JsonField(name = "ocs")
public HoverCardOCS ocs;
public HoverCardOCS getOcs() {
return this.ocs;
}
public void setOcs(HoverCardOCS ocs) {
this.ocs = ocs;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
HoverCardOverall that = (HoverCardOverall) o;
return Objects.equals(ocs, that.ocs);
}
@Override
public int hashCode() {
return Objects.hash(ocs);
}
@Override
public String toString() {
return "HoverCardOverall{" +
"ocs=" + ocs +
'}';
}
}

View File

@ -0,0 +1,33 @@
/*
*
* Nextcloud Talk application
*
* @author Tim Krüger
* Copyright (C) 2021-2022 Tim Krüger <t@timkrueger.me>
*
* 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.models.json.hovercard
import com.bluelinelabs.logansquare.annotation.JsonField
import com.bluelinelabs.logansquare.annotation.JsonObject
@JsonObject
data class HoverCardOverall(
@JsonField(name = ["ocs"])
var ocs: HoverCardOCS?
) {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null)
}

View File

@ -2,6 +2,8 @@
* Nextcloud Talk application * Nextcloud Talk application
* *
* @author Mario Danic * @author Mario Danic
* @author Tim Krüger
* Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
* Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com> * Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@ -28,25 +30,19 @@ import kotlinx.android.parcel.Parcelize
@JsonObject @JsonObject
data class Mention( data class Mention(
@JsonField(name = ["id"]) @JsonField(name = ["id"])
var id: String, var id: String?,
@JsonField(name = ["label"]) @JsonField(name = ["label"])
var label: String, var label: String?,
// type of user (guests or users or calls) // type of user (guests or users or calls)
@JsonField(name = ["source"]) @JsonField(name = ["source"])
var source: String, var source: String?,
@JsonField(name = ["status"]) @JsonField(name = ["status"])
var status: String?, var status: String?,
@JsonField(name = ["statusIcon"]) @JsonField(name = ["statusIcon"])
var statusIcon: String?, var statusIcon: String?,
@JsonField(name = ["statusMessage"]) @JsonField(name = ["statusMessage"])
var statusMessage: String? var statusMessage: String?
) : Parcelable { ) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this("", "", "", "", "", "") constructor() : this(null, null, null, null, null, null)
} }

View File

@ -1,76 +0,0 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017-2018 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.models.json.mention;
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.List;
@Parcel
@JsonObject
public class MentionOCS extends GenericOCS {
@JsonField(name = "data")
List<Mention> data;
public List<Mention> getData() {
return this.data;
}
public void setData(List<Mention> data) {
this.data = data;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof MentionOCS)) {
return false;
}
final MentionOCS other = (MentionOCS) o;
if (!other.canEqual((Object) this)) {
return false;
}
final Object this$data = this.getData();
final Object other$data = other.getData();
return this$data == null ? other$data == null : this$data.equals(other$data);
}
protected boolean canEqual(final Object other) {
return other instanceof MentionOCS;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $data = this.getData();
result = result * PRIME + ($data == null ? 43 : $data.hashCode());
return result;
}
public String toString() {
return "MentionOCS(data=" + this.getData() + ")";
}
}

View File

@ -0,0 +1,38 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Tim Krüger
* Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
* Copyright (C) 2017-2018 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.models.json.mention
import android.os.Parcelable
import com.bluelinelabs.logansquare.annotation.JsonField
import com.bluelinelabs.logansquare.annotation.JsonObject
import com.nextcloud.talk.models.json.generic.GenericOCS
import kotlinx.android.parcel.Parcelize
@Parcelize
@JsonObject
data class MentionOCS(
@JsonField(name = ["data"])
var data: List<Mention>?
) : GenericOCS(), Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null)
}

View File

@ -1,73 +0,0 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017-2018 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.models.json.mention;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.parceler.Parcel;
@Parcel
@JsonObject
public class MentionOverall {
@JsonField(name = "ocs")
MentionOCS ocs;
public MentionOCS getOcs() {
return this.ocs;
}
public void setOcs(MentionOCS ocs) {
this.ocs = ocs;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof MentionOverall)) {
return false;
}
final MentionOverall other = (MentionOverall) 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 MentionOverall;
}
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 "MentionOverall(ocs=" + this.getOcs() + ")";
}
}

View File

@ -0,0 +1,37 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Tim Krüger
* Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
* Copyright (C) 2017-2018 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.models.json.mention
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 MentionOverall(
@JsonField(name = ["ocs"])
var ocs: MentionOCS?
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null)
}

View File

@ -1,314 +0,0 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017-2018 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.models.json.notifications;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import com.nextcloud.talk.models.json.converters.LoganSquareJodaTimeConverter;
import org.joda.time.DateTime;
import org.parceler.Parcel;
import java.util.HashMap;
import java.util.List;
@Parcel
@JsonObject
public class Notification {
@JsonField(name = "icon")
public String icon;
@JsonField(name = "notification_id")
int notificationId;
@JsonField(name = "app")
String app;
@JsonField(name = "user")
String user;
@JsonField(name = "datetime", typeConverter = LoganSquareJodaTimeConverter.class)
DateTime datetime;
@JsonField(name = "object_type")
String objectType;
@JsonField(name = "object_id")
String objectId;
@JsonField(name = "subject")
String subject;
@JsonField(name = "subjectRich")
String subjectRich;
@JsonField(name = "subjectRichParameters")
HashMap<String, HashMap<String, String>> subjectRichParameters;
@JsonField(name = "message")
String message;
@JsonField(name = "messageRich")
String messageRich;
@JsonField(name = "messageRichParameters")
HashMap<String, HashMap<String, String>> messageRichParameters;
@JsonField(name = "link")
String link;
@JsonField(name = "actions")
List<NotificationAction> actions;
public String getIcon() {
return this.icon;
}
public int getNotificationId() {
return this.notificationId;
}
public String getApp() {
return this.app;
}
public String getUser() {
return this.user;
}
public DateTime getDatetime() {
return this.datetime;
}
public String getObjectType() {
return this.objectType;
}
public String getObjectId() {
return this.objectId;
}
public String getSubject() {
return this.subject;
}
public String getSubjectRich() {
return this.subjectRich;
}
public HashMap<String, HashMap<String, String>> getSubjectRichParameters() {
return this.subjectRichParameters;
}
public String getMessage() {
return this.message;
}
public String getMessageRich() {
return this.messageRich;
}
public HashMap<String, HashMap<String, String>> getMessageRichParameters() {
return this.messageRichParameters;
}
public String getLink() {
return this.link;
}
public List<NotificationAction> getActions() {
return this.actions;
}
public void setIcon(String icon) {
this.icon = icon;
}
public void setNotificationId(int notificationId) {
this.notificationId = notificationId;
}
public void setApp(String app) {
this.app = app;
}
public void setUser(String user) {
this.user = user;
}
public void setDatetime(DateTime datetime) {
this.datetime = datetime;
}
public void setObjectType(String objectType) {
this.objectType = objectType;
}
public void setObjectId(String objectId) {
this.objectId = objectId;
}
public void setSubject(String subject) {
this.subject = subject;
}
public void setSubjectRich(String subjectRich) {
this.subjectRich = subjectRich;
}
public void setSubjectRichParameters(HashMap<String, HashMap<String, String>> subjectRichParameters) {
this.subjectRichParameters = subjectRichParameters;
}
public void setMessage(String message) {
this.message = message;
}
public void setMessageRich(String messageRich) {
this.messageRich = messageRich;
}
public void setMessageRichParameters(HashMap<String, HashMap<String, String>> messageRichParameters) {
this.messageRichParameters = messageRichParameters;
}
public void setLink(String link) {
this.link = link;
}
public void setActions(List<NotificationAction> actions) {
this.actions = actions;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof Notification)) {
return false;
}
final Notification other = (Notification) o;
if (!other.canEqual((Object) this)) {
return false;
}
final Object this$icon = this.getIcon();
final Object other$icon = other.getIcon();
if (this$icon == null ? other$icon != null : !this$icon.equals(other$icon)) {
return false;
}
if (this.getNotificationId() != other.getNotificationId()) {
return false;
}
final Object this$app = this.getApp();
final Object other$app = other.getApp();
if (this$app == null ? other$app != null : !this$app.equals(other$app)) {
return false;
}
final Object this$user = this.getUser();
final Object other$user = other.getUser();
if (this$user == null ? other$user != null : !this$user.equals(other$user)) {
return false;
}
final Object this$datetime = this.getDatetime();
final Object other$datetime = other.getDatetime();
if (this$datetime == null ? other$datetime != null : !this$datetime.equals(other$datetime)) {
return false;
}
final Object this$objectType = this.getObjectType();
final Object other$objectType = other.getObjectType();
if (this$objectType == null ? other$objectType != null : !this$objectType.equals(other$objectType)) {
return false;
}
final Object this$objectId = this.getObjectId();
final Object other$objectId = other.getObjectId();
if (this$objectId == null ? other$objectId != null : !this$objectId.equals(other$objectId)) {
return false;
}
final Object this$subject = this.getSubject();
final Object other$subject = other.getSubject();
if (this$subject == null ? other$subject != null : !this$subject.equals(other$subject)) {
return false;
}
final Object this$subjectRich = this.getSubjectRich();
final Object other$subjectRich = other.getSubjectRich();
if (this$subjectRich == null ? other$subjectRich != null : !this$subjectRich.equals(other$subjectRich)) {
return false;
}
final Object this$subjectRichParameters = this.getSubjectRichParameters();
final Object other$subjectRichParameters = other.getSubjectRichParameters();
if (this$subjectRichParameters == null ? other$subjectRichParameters != null : !this$subjectRichParameters.equals(other$subjectRichParameters)) {
return false;
}
final Object this$message = this.getMessage();
final Object other$message = other.getMessage();
if (this$message == null ? other$message != null : !this$message.equals(other$message)) {
return false;
}
final Object this$messageRich = this.getMessageRich();
final Object other$messageRich = other.getMessageRich();
if (this$messageRich == null ? other$messageRich != null : !this$messageRich.equals(other$messageRich)) {
return false;
}
final Object this$messageRichParameters = this.getMessageRichParameters();
final Object other$messageRichParameters = other.getMessageRichParameters();
if (this$messageRichParameters == null ? other$messageRichParameters != null : !this$messageRichParameters.equals(other$messageRichParameters)) {
return false;
}
final Object this$link = this.getLink();
final Object other$link = other.getLink();
if (this$link == null ? other$link != null : !this$link.equals(other$link)) {
return false;
}
final Object this$actions = this.getActions();
final Object other$actions = other.getActions();
return this$actions == null ? other$actions == null : this$actions.equals(other$actions);
}
protected boolean canEqual(final Object other) {
return other instanceof Notification;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $icon = this.getIcon();
result = result * PRIME + ($icon == null ? 43 : $icon.hashCode());
result = result * PRIME + this.getNotificationId();
final Object $app = this.getApp();
result = result * PRIME + ($app == null ? 43 : $app.hashCode());
final Object $user = this.getUser();
result = result * PRIME + ($user == null ? 43 : $user.hashCode());
final Object $datetime = this.getDatetime();
result = result * PRIME + ($datetime == null ? 43 : $datetime.hashCode());
final Object $objectType = this.getObjectType();
result = result * PRIME + ($objectType == null ? 43 : $objectType.hashCode());
final Object $objectId = this.getObjectId();
result = result * PRIME + ($objectId == null ? 43 : $objectId.hashCode());
final Object $subject = this.getSubject();
result = result * PRIME + ($subject == null ? 43 : $subject.hashCode());
final Object $subjectRich = this.getSubjectRich();
result = result * PRIME + ($subjectRich == null ? 43 : $subjectRich.hashCode());
final Object $subjectRichParameters = this.getSubjectRichParameters();
result = result * PRIME + ($subjectRichParameters == null ? 43 : $subjectRichParameters.hashCode());
final Object $message = this.getMessage();
result = result * PRIME + ($message == null ? 43 : $message.hashCode());
final Object $messageRich = this.getMessageRich();
result = result * PRIME + ($messageRich == null ? 43 : $messageRich.hashCode());
final Object $messageRichParameters = this.getMessageRichParameters();
result = result * PRIME + ($messageRichParameters == null ? 43 : $messageRichParameters.hashCode());
final Object $link = this.getLink();
result = result * PRIME + ($link == null ? 43 : $link.hashCode());
final Object $actions = this.getActions();
result = result * PRIME + ($actions == null ? 43 : $actions.hashCode());
return result;
}
public String toString() {
return "Notification(icon=" + this.getIcon() + ", notificationId=" + this.getNotificationId() + ", app=" + this.getApp() + ", user=" + this.getUser() + ", datetime=" + this.getDatetime() + ", objectType=" + this.getObjectType() + ", objectId=" + this.getObjectId() + ", subject=" + this.getSubject() + ", subjectRich=" + this.getSubjectRich() + ", subjectRichParameters=" + this.getSubjectRichParameters() + ", message=" + this.getMessage() + ", messageRich=" + this.getMessageRich() + ", messageRichParameters=" + this.getMessageRichParameters() + ", link=" + this.getLink() + ", actions=" + this.getActions() + ")";
}
}

View File

@ -0,0 +1,67 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Tim Krüger
* Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
* Copyright (C) 2017-2018 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.models.json.notifications
import android.os.Parcelable
import com.bluelinelabs.logansquare.annotation.JsonField
import com.bluelinelabs.logansquare.annotation.JsonObject
import com.nextcloud.talk.models.json.converters.LoganSquareJodaTimeConverter
import kotlinx.android.parcel.Parcelize
import org.joda.time.DateTime
@Parcelize
@JsonObject
data class Notification(
@JsonField(name = ["icon"])
var icon: String?,
@JsonField(name = ["notification_id"])
var notificationId: Int?,
@JsonField(name = ["app"])
var app: String?,
@JsonField(name = ["user"])
var user: String?,
@JsonField(name = ["datetime"], typeConverter = LoganSquareJodaTimeConverter::class)
var datetime: DateTime?,
@JsonField(name = ["object_type"])
var objectType: String?,
@JsonField(name = ["object_id"])
var objectId: String?,
@JsonField(name = ["subject"])
var subject: String?,
@JsonField(name = ["subjectRich"])
var subjectRich: String?,
@JsonField(name = ["subjectRichParameters"])
var subjectRichParameters: HashMap<String, HashMap<String, String>>?,
@JsonField(name = ["message"])
var message: String?,
@JsonField(name = ["messageRich"])
var messageRich: String?,
@JsonField(name = ["messageRichParameters"])
var messageRichParameters: HashMap<String, HashMap<String, String>>?,
@JsonField(name = ["link"])
var link: String?,
@JsonField(name = ["actions"])
var actions: List<NotificationAction>?
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null)
}

View File

@ -1,125 +0,0 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017-2018 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.models.json.notifications;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.parceler.Parcel;
@Parcel
@JsonObject
public class NotificationAction {
@JsonField(name = "label")
String label;
@JsonField(name = "link")
String link;
@JsonField(name = "type")
String type;
@JsonField(name = "primary")
boolean primary;
public String getLabel() {
return this.label;
}
public String getLink() {
return this.link;
}
public String getType() {
return this.type;
}
public boolean isPrimary() {
return this.primary;
}
public void setLabel(String label) {
this.label = label;
}
public void setLink(String link) {
this.link = link;
}
public void setType(String type) {
this.type = type;
}
public void setPrimary(boolean primary) {
this.primary = primary;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof NotificationAction)) {
return false;
}
final NotificationAction other = (NotificationAction) o;
if (!other.canEqual((Object) this)) {
return false;
}
final Object this$label = this.getLabel();
final Object other$label = other.getLabel();
if (this$label == null ? other$label != null : !this$label.equals(other$label)) {
return false;
}
final Object this$link = this.getLink();
final Object other$link = other.getLink();
if (this$link == null ? other$link != null : !this$link.equals(other$link)) {
return false;
}
final Object this$type = this.getType();
final Object other$type = other.getType();
if (this$type == null ? other$type != null : !this$type.equals(other$type)) {
return false;
}
return this.isPrimary() == other.isPrimary();
}
protected boolean canEqual(final Object other) {
return other instanceof NotificationAction;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $label = this.getLabel();
result = result * PRIME + ($label == null ? 43 : $label.hashCode());
final Object $link = this.getLink();
result = result * PRIME + ($link == null ? 43 : $link.hashCode());
final Object $type = this.getType();
result = result * PRIME + ($type == null ? 43 : $type.hashCode());
result = result * PRIME + (this.isPrimary() ? 79 : 97);
return result;
}
public String toString() {
return "NotificationAction(label=" + this.getLabel() + ", link=" + this.getLink() + ", type=" + this.getType() + ", primary=" + this.isPrimary() + ")";
}
}

View File

@ -0,0 +1,43 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Tim Krüger
* Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
* Copyright (C) 2017-2018 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.models.json.notifications
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 NotificationAction(
@JsonField(name = ["label"])
var label: String?,
@JsonField(name = ["link"])
var link: String?,
@JsonField(name = ["type"])
var type: String?,
@JsonField(name = ["primary"])
var primary: Boolean
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null, null, null, false)
}

View File

@ -1,75 +0,0 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017-2018 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.models.json.notifications;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import com.nextcloud.talk.models.json.generic.GenericOCS;
import org.parceler.Parcel;
@Parcel
@JsonObject
public class NotificationOCS extends GenericOCS {
@JsonField(name = "data")
Notification notification;
public Notification getNotification() {
return this.notification;
}
public void setNotification(Notification notification) {
this.notification = notification;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof NotificationOCS)) {
return false;
}
final NotificationOCS other = (NotificationOCS) o;
if (!other.canEqual((Object) this)) {
return false;
}
final Object this$notification = this.getNotification();
final Object other$notification = other.getNotification();
return this$notification == null ? other$notification == null : this$notification.equals(other$notification);
}
protected boolean canEqual(final Object other) {
return other instanceof NotificationOCS;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $notification = this.getNotification();
result = result * PRIME + ($notification == null ? 43 : $notification.hashCode());
return result;
}
public String toString() {
return "NotificationOCS(notification=" + this.getNotification() + ")";
}
}

View File

@ -0,0 +1,38 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Tim Krüger
* Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
* Copyright (C) 2017-2018 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.models.json.notifications
import android.os.Parcelable
import com.bluelinelabs.logansquare.annotation.JsonField
import com.bluelinelabs.logansquare.annotation.JsonObject
import com.nextcloud.talk.models.json.generic.GenericOCS
import kotlinx.android.parcel.Parcelize
@Parcelize
@JsonObject
data class NotificationOCS(
@JsonField(name = ["data"])
var notification: Notification?
) : GenericOCS(), Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null)
}

View File

@ -1,70 +0,0 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017-2018 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.models.json.notifications;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
@JsonObject
public class NotificationOverall {
@JsonField(name = "ocs")
NotificationOCS ocs;
public NotificationOCS getOcs() {
return this.ocs;
}
public void setOcs(NotificationOCS ocs) {
this.ocs = ocs;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof NotificationOverall)) {
return false;
}
final NotificationOverall other = (NotificationOverall) 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 NotificationOverall;
}
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 "NotificationOverall(ocs=" + this.getOcs() + ")";
}
}

View File

@ -0,0 +1,34 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Tim Krüger
* Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
* Copyright (C) 2017-2018 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.models.json.notifications
import com.bluelinelabs.logansquare.annotation.JsonField
import com.bluelinelabs.logansquare.annotation.JsonObject
@JsonObject
data class NotificationOverall(
@JsonField(name = ["ocs"])
var ocs: NotificationOCS?
) {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null)
}

View File

@ -1,109 +0,0 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017-2018 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.models.json.notifications;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.parceler.Parcel;
@Parcel
@JsonObject
public class NotificationRichObject {
@JsonField(name = "id")
String label;
@JsonField(name = "type")
String type;
@JsonField(name = "name")
String name;
public String getLabel() {
return this.label;
}
public String getType() {
return this.type;
}
public String getName() {
return this.name;
}
public void setLabel(String label) {
this.label = label;
}
public void setType(String type) {
this.type = type;
}
public void setName(String name) {
this.name = name;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof NotificationRichObject)) {
return false;
}
final NotificationRichObject other = (NotificationRichObject) o;
if (!other.canEqual((Object) this)) {
return false;
}
final Object this$label = this.getLabel();
final Object other$label = other.getLabel();
if (this$label == null ? other$label != null : !this$label.equals(other$label)) {
return false;
}
final Object this$type = this.getType();
final Object other$type = other.getType();
if (this$type == null ? other$type != null : !this$type.equals(other$type)) {
return false;
}
final Object this$name = this.getName();
final Object other$name = other.getName();
return this$name == null ? other$name == null : this$name.equals(other$name);
}
protected boolean canEqual(final Object other) {
return other instanceof NotificationRichObject;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $label = this.getLabel();
result = result * PRIME + ($label == null ? 43 : $label.hashCode());
final Object $type = this.getType();
result = result * PRIME + ($type == null ? 43 : $type.hashCode());
final Object $name = this.getName();
return result * PRIME + ($name == null ? 43 : $name.hashCode());
}
public String toString() {
return "NotificationRichObject(label=" + this.getLabel() + ", type=" + this.getType() + ", name=" + this.getName() + ")";
}
}

View File

@ -0,0 +1,41 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Tim Krüger
* Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
* Copyright (C) 2017-2018 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.models.json.notifications
import android.os.Parcelable
import com.bluelinelabs.logansquare.annotation.JsonField
import com.bluelinelabs.logansquare.annotation.JsonObject
import kotlinx.android.parcel.Parcelize
@Parcelize
@JsonObject
class NotificationRichObject(
@JsonField(name = ["id"])
var label: String?,
@JsonField(name = ["type"])
var type: String?,
@JsonField(name = ["name"])
var name: String?
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null, null, null)
}

View File

@ -1,77 +0,0 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017-2018 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.models.json.notifications;
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.List;
@Parcel
@JsonObject
public class NotificationsOCS extends GenericOCS {
@JsonField(name = "data")
List<Notification> notificationsList;
public List<Notification> getNotificationsList() {
return this.notificationsList;
}
public void setNotificationsList(List<Notification> notificationsList) {
this.notificationsList = notificationsList;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof NotificationsOCS)) {
return false;
}
final NotificationsOCS other = (NotificationsOCS) o;
if (!other.canEqual((Object) this)) {
return false;
}
final Object this$notificationsList = this.getNotificationsList();
final Object other$notificationsList = other.getNotificationsList();
return this$notificationsList == null ? other$notificationsList == null : this$notificationsList.equals(other$notificationsList);
}
protected boolean canEqual(final Object other) {
return other instanceof NotificationsOCS;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $notificationsList = this.getNotificationsList();
result = result * PRIME + ($notificationsList == null ? 43 : $notificationsList.hashCode());
return result;
}
public String toString() {
return "NotificationsOCS(notificationsList=" + this.getNotificationsList() + ")";
}
}

View File

@ -0,0 +1,38 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Tim Krüger
* Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
* Copyright (C) 2017-2018 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.models.json.notifications
import android.os.Parcelable
import com.bluelinelabs.logansquare.annotation.JsonField
import com.bluelinelabs.logansquare.annotation.JsonObject
import com.nextcloud.talk.models.json.generic.GenericOCS
import kotlinx.android.parcel.Parcelize
@Parcelize
@JsonObject
class NotificationsOCS(
@JsonField(name = ["data"])
var notificationsList: List<Notification>?
) : GenericOCS(), Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null)
}

View File

@ -1,70 +0,0 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017-2018 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.models.json.notifications;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
@JsonObject
public class NotificationsOverall {
@JsonField(name = "ocs")
NotificationsOCS ocs;
public NotificationsOCS getOcs() {
return this.ocs;
}
public void setOcs(NotificationsOCS ocs) {
this.ocs = ocs;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof NotificationsOverall)) {
return false;
}
final NotificationsOverall other = (NotificationsOverall) 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 NotificationsOverall;
}
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 "NotificationsOverall(ocs=" + this.getOcs() + ")";
}
}

View File

@ -0,0 +1,34 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Tim Krüger
* Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
* Copyright (C) 2017-2018 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.models.json.notifications
import com.bluelinelabs.logansquare.annotation.JsonField
import com.bluelinelabs.logansquare.annotation.JsonObject
@JsonObject
class NotificationsOverall(
@JsonField(name = ["ocs"])
var ocs: NotificationsOCS?
) {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null)
}

View File

@ -20,6 +20,7 @@
*/ */
package com.nextcloud.talk.ui.bottom.sheet package com.nextcloud.talk.ui.bottom.sheet
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
@ -61,13 +62,17 @@ class ProfileBottomSheet(val ncApi: NcApi, val userEntity: UserEntity, val route
ApiUtils.getCredentials(userEntity.username, userEntity.token), ApiUtils.getCredentials(userEntity.username, userEntity.token),
ApiUtils.getUrlForHoverCard(userEntity.baseUrl, user) ApiUtils.getUrlForHoverCard(userEntity.baseUrl, user)
).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) ).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(object : io.reactivex.Observer<HoverCardOverall> { .subscribe(object : Observer<HoverCardOverall> {
override fun onSubscribe(d: Disposable) { override fun onSubscribe(d: Disposable) {
// unused atm // unused atm
} }
override fun onNext(hoverCardOverall: HoverCardOverall) { override fun onNext(hoverCardOverall: HoverCardOverall) {
bottomSheet(hoverCardOverall.ocs.data.actions, hoverCardOverall.ocs.data.displayName, user, context) bottomSheet(
hoverCardOverall.ocs!!.data!!.actions!!, hoverCardOverall.ocs!!.data!!.displayName!!,
user,
context
)
} }
override fun onError(e: Throwable) { override fun onError(e: Throwable) {
@ -80,6 +85,7 @@ class ProfileBottomSheet(val ncApi: NcApi, val userEntity: UserEntity, val route
}) })
} }
@SuppressLint("CheckResult")
private fun bottomSheet(actions: List<HoverCardAction>, displayName: String, userId: String, context: Context) { private fun bottomSheet(actions: List<HoverCardAction>, displayName: String, userId: String, context: Context) {
val filteredActions = actions.filter { allowedAppIds.contains(it.appId) } val filteredActions = actions.filter { allowedAppIds.contains(it.appId) }
@ -94,8 +100,8 @@ class ProfileBottomSheet(val ncApi: NcApi, val userEntity: UserEntity, val route
val action = filteredActions[index] val action = filteredActions[index]
when (AllowedAppIds.createFor(action)) { when (AllowedAppIds.createFor(action)) {
PROFILE -> openProfile(action.hyperlink, context) PROFILE -> openProfile(action.hyperlink!!, context)
EMAIL -> composeEmail(action.title, context) EMAIL -> composeEmail(action.title!!, context)
SPREED -> talkTo(userId) SPREED -> talkTo(userId)
} }
} }
@ -112,7 +118,7 @@ class ProfileBottomSheet(val ncApi: NcApi, val userEntity: UserEntity, val route
return BasicListItemWithImage( return BasicListItemWithImage(
drawable, drawable,
action.title action.title!!
) )
} }
@ -129,7 +135,7 @@ class ProfileBottomSheet(val ncApi: NcApi, val userEntity: UserEntity, val route
null null
) )
val credentials = ApiUtils.getCredentials(userEntity.username, userEntity.token) val credentials = ApiUtils.getCredentials(userEntity.username, userEntity.token)
ncApi!!.createRoom( ncApi.createRoom(
credentials, credentials,
retrofitBucket.getUrl(), retrofitBucket.getQueryMap() retrofitBucket.getUrl(), retrofitBucket.getQueryMap()
) )
@ -147,7 +153,7 @@ class ProfileBottomSheet(val ncApi: NcApi, val userEntity: UserEntity, val route
bundle.putString(BundleKeys.KEY_ROOM_ID, roomOverall.getOcs().getData().getRoomId()) bundle.putString(BundleKeys.KEY_ROOM_ID, roomOverall.getOcs().getData().getRoomId())
// FIXME once APIv2+ is used only, the createRoom already returns all the data // FIXME once APIv2+ is used only, the createRoom already returns all the data
ncApi!!.getRoom( ncApi.getRoom(
credentials, credentials,
ApiUtils.getUrlForRoom( ApiUtils.getUrlForRoom(
apiVersion, userEntity.baseUrl, apiVersion, userEntity.baseUrl,
@ -213,7 +219,7 @@ class ProfileBottomSheet(val ncApi: NcApi, val userEntity: UserEntity, val route
EMAIL("email"); EMAIL("email");
companion object { companion object {
fun createFor(action: HoverCardAction): AllowedAppIds = valueOf(action.appId.uppercase()) fun createFor(action: HoverCardAction): AllowedAppIds = valueOf(action.appId!!.uppercase())
} }
} }
} }

View File

@ -1 +1 @@
483 453