Migrate general models to kotlin data classes

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-05-18 00:01:12 +02:00
parent f56d7dbcbc
commit 18d375b540
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
17 changed files with 200 additions and 483 deletions

View File

@ -191,16 +191,16 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
if (delete) {
cancelExistingNotificationWithId(
applicationContext,
signatureVerification!!.userEntity,
signatureVerification!!.userEntity!!,
notificationId
)
} else if (deleteAll) {
cancelAllNotificationsForAccount(applicationContext, signatureVerification!!.userEntity)
cancelAllNotificationsForAccount(applicationContext, signatureVerification!!.userEntity!!)
} else if (deleteMultiple) {
notificationIds!!.forEach {
cancelExistingNotificationWithId(
applicationContext,
signatureVerification!!.userEntity,
signatureVerification!!.userEntity!!,
it
)
}
@ -222,7 +222,7 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
val soundUri = getCallRingtoneUri(applicationContext!!, appPreferences!!)
val notificationChannelId = NotificationUtils.NOTIFICATION_CHANNEL_CALLS_V4
val uri = Uri.parse(signatureVerification!!.userEntity.baseUrl)
val uri = Uri.parse(signatureVerification!!.userEntity!!.baseUrl)
val baseUrl = uri.host
val notification =
@ -275,10 +275,13 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
)
ncApi.getPeersForCall(
ApiUtils.getCredentials(signatureVerification.userEntity.username, signatureVerification.userEntity.token),
ApiUtils.getCredentials(
signatureVerification.userEntity!!.username,
signatureVerification.userEntity!!.token
),
ApiUtils.getUrlForCall(
apiVersion,
signatureVerification.userEntity.baseUrl,
signatureVerification.userEntity!!.baseUrl,
decryptedPushMessage.id
)
)
@ -298,7 +301,7 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
hasParticipantsInCall = participantList.isNotEmpty()
if (hasParticipantsInCall) {
for (participant in participantList) {
if (participant.actorId == signatureVerification.userEntity.userId &&
if (participant.actorId == signatureVerification.userEntity!!.userId &&
participant.actorType == Participant.ActorType.USERS
) {
inCallOnDifferentDevice = true

View File

@ -2641,7 +2641,7 @@ class ChatController(args: Bundle) :
)
ncApi!!.createRoom(
credentials,
retrofitBucket.getUrl(), retrofitBucket.getQueryMap()
retrofitBucket.url, retrofitBucket.queryMap
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())

View File

@ -252,7 +252,7 @@ class ContactsController(args: Bundle) :
)
ncApi.createRoom(
credentials,
retrofitBucket.getUrl(), retrofitBucket.getQueryMap()
retrofitBucket.url, retrofitBucket.queryMap
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
@ -393,7 +393,7 @@ class ContactsController(args: Bundle) :
val query = adapter!!.getFilter(String::class.java) as String?
val retrofitBucket: RetrofitBucket =
ApiUtils.getRetrofitBucketForContactsSearchFor14(currentUser!!.baseUrl, query)
val modifiedQueryMap: HashMap<String, Any?> = HashMap<String, Any?>(retrofitBucket.getQueryMap())
val modifiedQueryMap: HashMap<String, Any?> = HashMap<String, Any?>(retrofitBucket.queryMap)
modifiedQueryMap.put("limit", CONTACTS_BATCH_SIZE)
if (isAddingParticipantsView) {
modifiedQueryMap.put("itemId", conversationToken)
@ -417,7 +417,7 @@ class ContactsController(args: Bundle) :
modifiedQueryMap.put("shareTypes[]", shareTypesList)
ncApi.getContactsWithSearchParam(
credentials,
retrofitBucket.getUrl(), shareTypesList, modifiedQueryMap
retrofitBucket.url, shareTypesList, modifiedQueryMap
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
@ -815,7 +815,7 @@ class ContactsController(args: Bundle) :
)
ncApi.createRoom(
credentials,
retrofitBucket.getUrl(), retrofitBucket.getQueryMap()
retrofitBucket.url, retrofitBucket.queryMap
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())

View File

@ -119,16 +119,16 @@ class RingtoneSelectionController(args: Bundle) :
try {
val ringtoneSettings: RingtoneSettings =
LoganSquare.parse<RingtoneSettings>(preferencesString, RingtoneSettings::class.java)
if (ringtoneSettings.getRingtoneUri() == null) {
if (ringtoneSettings.ringtoneUri == null) {
adapter!!.toggleSelection(0)
} else if (ringtoneSettings.getRingtoneUri().toString() == ringtoneString) {
} else if (ringtoneSettings.ringtoneUri!!.toString() == ringtoneString) {
adapter!!.toggleSelection(1)
} else {
var notificationSoundItem: NotificationSoundItem?
for (i in 2 until adapter!!.itemCount) {
notificationSoundItem = adapter!!.getItem(i) as NotificationSoundItem?
if (
notificationSoundItem!!.notificationSoundUri == ringtoneSettings.getRingtoneUri().toString()
notificationSoundItem!!.notificationSoundUri == ringtoneSettings.ringtoneUri!!.toString()
) {
adapter!!.toggleSelection(i)
break
@ -199,8 +199,8 @@ class RingtoneSelectionController(args: Bundle) :
}
if (adapter!!.selectedPositions.size == 0 || adapter!!.selectedPositions[0] != position) {
val ringtoneSettings = RingtoneSettings()
ringtoneSettings.setRingtoneName(notificationSoundItem.notificationSoundName)
ringtoneSettings.setRingtoneUri(ringtoneUri)
ringtoneSettings.ringtoneName = notificationSoundItem.notificationSoundName
ringtoneSettings.ringtoneUri = ringtoneUri
if (callNotificationSounds) {
try {
appPreferences!!.callRingtoneUri = LoganSquare.serialize(ringtoneSettings)

View File

@ -391,7 +391,7 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
conversationName
)
}
ncApi.createRoom(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
ncApi.createRoom(credentials, retrofitBucket.url, retrofitBucket.queryMap)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(1)
@ -642,7 +642,7 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
conversation!!.token,
userId
)
ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
ncApi.addParticipant(credentials, retrofitBucket.url, retrofitBucket.queryMap)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(1)
@ -687,7 +687,7 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
"groups",
groupId
)
ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
ncApi.addParticipant(credentials, retrofitBucket.url, retrofitBucket.queryMap)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.retry(1)

View File

@ -510,7 +510,7 @@ public class NotificationWorker extends Worker {
signatureVerification = pushUtils.verifySignature(base64DecodedSignature,
base64DecodedSubject);
if (signatureVerification.isSignatureValid()) {
if (signatureVerification.getSignatureValid()) {
Cipher cipher = Cipher.getInstance("RSA/None/PKCS1Padding");
cipher.init(Cipher.DECRYPT_MODE, privateKey);
byte[] decryptedSubject = cipher.doFinal(base64DecodedSubject);

View File

@ -1,91 +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;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import org.parceler.Parcel;
@Parcel
@JsonObject
public class ExternalSignalingServer {
@JsonField(name = "externalSignalingServer")
String externalSignalingServer;
@JsonField(name = "externalSignalingTicket")
String externalSignalingTicket;
public String getExternalSignalingServer() {
return this.externalSignalingServer;
}
public String getExternalSignalingTicket() {
return this.externalSignalingTicket;
}
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 ExternalSignalingServer)) {
return false;
}
final ExternalSignalingServer other = (ExternalSignalingServer) o;
if (!other.canEqual((Object) this)) {
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 ExternalSignalingServer;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
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 "ExternalSignalingServer(externalSignalingServer=" + this.getExternalSignalingServer() + ", externalSignalingTicket=" + this.getExternalSignalingTicket() + ")";
}
}

View File

@ -0,0 +1,39 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Andy Scherzinger
* Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
* 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
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 ExternalSignalingServer(
@JsonField(name = ["externalSignalingServer"])
var externalSignalingServer: String? = null,
@JsonField(name = ["externalSignalingTicket"])
var externalSignalingTicket: String? = null
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null, null)
}

View File

@ -1,101 +0,0 @@
/*
*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models;
import org.parceler.Parcel;
@Parcel
public class LoginData {
String serverUrl;
String username;
String token;
public String getServerUrl() {
return this.serverUrl;
}
public String getUsername() {
return this.username;
}
public String getToken() {
return this.token;
}
public void setServerUrl(String serverUrl) {
this.serverUrl = serverUrl;
}
public void setUsername(String username) {
this.username = username;
}
public void setToken(String token) {
this.token = token;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof LoginData)) {
return false;
}
final LoginData other = (LoginData) o;
if (!other.canEqual((Object) this)) {
return false;
}
final Object this$serverUrl = this.getServerUrl();
final Object other$serverUrl = other.getServerUrl();
if (this$serverUrl == null ? other$serverUrl != null : !this$serverUrl.equals(other$serverUrl)) {
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$token = this.getToken();
final Object other$token = other.getToken();
return this$token == null ? other$token == null : this$token.equals(other$token);
}
protected boolean canEqual(final Object other) {
return other instanceof LoginData;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $serverUrl = this.getServerUrl();
result = result * PRIME + ($serverUrl == null ? 43 : $serverUrl.hashCode());
final Object $username = this.getUsername();
result = result * PRIME + ($username == null ? 43 : $username.hashCode());
final Object $token = this.getToken();
result = result * PRIME + ($token == null ? 43 : $token.hashCode());
return result;
}
public String toString() {
return "LoginData(serverUrl=" + this.getServerUrl() + ", username=" + this.getUsername() + ", token=" + this.getToken() + ")";
}
}

View File

@ -0,0 +1,32 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Andy Scherzinger
* Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
* Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models
import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
@Parcelize
data class LoginData(
var serverUrl: String? = null,
var username: String? = null,
var token: String? = null
) : Parcelable

View File

@ -1,86 +0,0 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models;
import org.parceler.Parcel;
import java.util.Map;
@Parcel
public class RetrofitBucket {
public String url;
public Map<String, String> queryMap;
public String getUrl() {
return this.url;
}
public Map<String, String> getQueryMap() {
return this.queryMap;
}
public void setUrl(String url) {
this.url = url;
}
public void setQueryMap(Map<String, String> queryMap) {
this.queryMap = queryMap;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof RetrofitBucket)) {
return false;
}
final RetrofitBucket other = (RetrofitBucket) 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$queryMap = this.getQueryMap();
final Object other$queryMap = other.getQueryMap();
return this$queryMap == null ? other$queryMap == null : this$queryMap.equals(other$queryMap);
}
protected boolean canEqual(final Object other) {
return other instanceof RetrofitBucket;
}
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 $queryMap = this.getQueryMap();
result = result * PRIME + ($queryMap == null ? 43 : $queryMap.hashCode());
return result;
}
public String toString() {
return "RetrofitBucket(url=" + this.getUrl() + ", queryMap=" + this.getQueryMap() + ")";
}
}

View File

@ -0,0 +1,31 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Andy Scherzinger
* Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
* Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models
import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
@Parcelize
data class RetrofitBucket(
var url: String? = null,
var queryMap: Map<String, String>? = null
) : Parcelable

View File

@ -1,98 +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;
import android.net.Uri;
import com.bluelinelabs.logansquare.annotation.JsonField;
import com.bluelinelabs.logansquare.annotation.JsonObject;
import com.nextcloud.talk.models.json.converters.UriTypeConverter;
import org.parceler.Parcel;
import androidx.annotation.Nullable;
@Parcel
@JsonObject
public class RingtoneSettings {
@JsonField(name = "ringtoneUri", typeConverter = UriTypeConverter.class)
@Nullable
public Uri ringtoneUri;
@JsonField(name = "ringtoneName")
public String ringtoneName;
@Nullable
public Uri getRingtoneUri() {
return this.ringtoneUri;
}
public String getRingtoneName() {
return this.ringtoneName;
}
public void setRingtoneUri(@Nullable Uri ringtoneUri) {
this.ringtoneUri = ringtoneUri;
}
public void setRingtoneName(String ringtoneName) {
this.ringtoneName = ringtoneName;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof RingtoneSettings)) {
return false;
}
final RingtoneSettings other = (RingtoneSettings) o;
if (!other.canEqual((Object) this)) {
return false;
}
final Object this$ringtoneUri = this.getRingtoneUri();
final Object other$ringtoneUri = other.getRingtoneUri();
if (this$ringtoneUri == null ? other$ringtoneUri != null : !this$ringtoneUri.equals(other$ringtoneUri)) {
return false;
}
final Object this$ringtoneName = this.getRingtoneName();
final Object other$ringtoneName = other.getRingtoneName();
return this$ringtoneName == null ? other$ringtoneName == null : this$ringtoneName.equals(other$ringtoneName);
}
protected boolean canEqual(final Object other) {
return other instanceof RingtoneSettings;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
final Object $ringtoneUri = this.getRingtoneUri();
result = result * PRIME + ($ringtoneUri == null ? 43 : $ringtoneUri.hashCode());
final Object $ringtoneName = this.getRingtoneName();
result = result * PRIME + ($ringtoneName == null ? 43 : $ringtoneName.hashCode());
return result;
}
public String toString() {
return "RingtoneSettings(ringtoneUri=" + this.getRingtoneUri() + ", ringtoneName=" + this.getRingtoneName() + ")";
}
}

View File

@ -0,0 +1,41 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Andy Scherzinger
* Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
* 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
import android.net.Uri
import android.os.Parcelable
import com.bluelinelabs.logansquare.annotation.JsonField
import com.bluelinelabs.logansquare.annotation.JsonObject
import com.nextcloud.talk.models.json.converters.UriTypeConverter
import kotlinx.android.parcel.Parcelize
@Parcelize
@JsonObject
data class RingtoneSettings(
@JsonField(name = ["ringtoneUri"], typeConverter = UriTypeConverter::class)
var ringtoneUri: Uri? = null,
@JsonField(name = ["ringtoneName"])
var ringtoneName: String? = null
) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null, null)
}

View File

@ -1,85 +0,0 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models;
import com.nextcloud.talk.models.database.UserEntity;
import org.parceler.Parcel;
@Parcel
public class SignatureVerification {
public boolean signatureValid;
public UserEntity userEntity;
public boolean isSignatureValid() {
return this.signatureValid;
}
public UserEntity getUserEntity() {
return this.userEntity;
}
public void setSignatureValid(boolean signatureValid) {
this.signatureValid = signatureValid;
}
public void setUserEntity(UserEntity userEntity) {
this.userEntity = userEntity;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof SignatureVerification)) {
return false;
}
final SignatureVerification other = (SignatureVerification) o;
if (!other.canEqual((Object) this)) {
return false;
}
if (this.isSignatureValid() != other.isSignatureValid()) {
return false;
}
final Object this$userEntity = this.getUserEntity();
final Object other$userEntity = other.getUserEntity();
return this$userEntity == null ? other$userEntity == null : this$userEntity.equals(other$userEntity);
}
protected boolean canEqual(final Object other) {
return other instanceof SignatureVerification;
}
public int hashCode() {
final int PRIME = 59;
int result = 1;
result = result * PRIME + (this.isSignatureValid() ? 79 : 97);
final Object $userEntity = this.getUserEntity();
result = result * PRIME + ($userEntity == null ? 43 : $userEntity.hashCode());
return result;
}
public String toString() {
return "SignatureVerification(signatureValid=" + this.isSignatureValid() + ", userEntity=" + this.getUserEntity() + ")";
}
}

View File

@ -0,0 +1,32 @@
/*
* Nextcloud Talk application
*
* @author Mario Danic
* @author Andy Scherzinger
* Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
* Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.nextcloud.talk.models
import android.os.Parcelable
import com.nextcloud.talk.models.database.UserEntity
import kotlinx.android.parcel.Parcelize
@Parcelize
data class SignatureVerification(
var signatureValid: Boolean = false,
var userEntity: UserEntity? = null
) : Parcelable

View File

@ -137,7 +137,7 @@ class ProfileBottomSheet(val ncApi: NcApi, val userEntity: UserEntity, val route
val credentials = ApiUtils.getCredentials(userEntity.username, userEntity.token)
ncApi.createRoom(
credentials,
retrofitBucket.getUrl(), retrofitBucket.getQueryMap()
retrofitBucket.url, retrofitBucket.queryMap
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())