diff --git a/cli/src/appleMain/kotlin/com/wire/kalium/cli/commands/InputAction.kt b/cli/src/appleMain/kotlin/com/wire/kalium/cli/commands/InputAction.kt index 3a449861139..e4a98a0a73c 100644 --- a/cli/src/appleMain/kotlin/com/wire/kalium/cli/commands/InputAction.kt +++ b/cli/src/appleMain/kotlin/com/wire/kalium/cli/commands/InputAction.kt @@ -32,5 +32,5 @@ sealed class InputAction { val command: Command ) : InputAction() - object Quit : InputAction() + data object Quit : InputAction() } diff --git a/cli/src/appleMain/kotlin/com/wire/kalium/cli/commands/InputFlow.kt b/cli/src/appleMain/kotlin/com/wire/kalium/cli/commands/InputFlow.kt index c8a1a801ee6..1199db7210d 100644 --- a/cli/src/appleMain/kotlin/com/wire/kalium/cli/commands/InputFlow.kt +++ b/cli/src/appleMain/kotlin/com/wire/kalium/cli/commands/InputFlow.kt @@ -91,14 +91,14 @@ fun readChar(): Input = sealed class Input { data class Character(val char: Char) : Input() - object ArrowUp : Input() - object ArrowDown : Input() - object ArrowLeft : Input() - object ArrowRight : Input() - object HomeKey : Input() - object EndKey : Input() - object DeleteKey : Input() - object PageUp : Input() - object PageDown : Input() - object Backspace : Input() + data object ArrowUp : Input() + data object ArrowDown : Input() + data object ArrowLeft : Input() + data object ArrowRight : Input() + data object HomeKey : Input() + data object EndKey : Input() + data object DeleteKey : Input() + data object PageUp : Input() + data object PageDown : Input() + data object Backspace : Input() } diff --git a/cli/src/appleMain/kotlin/com/wire/kalium/cli/commands/InteractiveCommand.kt b/cli/src/appleMain/kotlin/com/wire/kalium/cli/commands/InteractiveCommand.kt index 5e39c52a85f..23d11f0c5ae 100644 --- a/cli/src/appleMain/kotlin/com/wire/kalium/cli/commands/InteractiveCommand.kt +++ b/cli/src/appleMain/kotlin/com/wire/kalium/cli/commands/InteractiveCommand.kt @@ -56,7 +56,7 @@ import platform.posix.tcsetattr import platform.posix.termios sealed class PosixSignal { - object WindowChanged : PosixSignal() + data object WindowChanged : PosixSignal() } private val signalFlow = MutableSharedFlow() diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/CoreFailure.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/CoreFailure.kt index 29a7b6bc540..e54ced20128 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/CoreFailure.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/CoreFailure.kt @@ -164,24 +164,24 @@ sealed class NetworkFailure : CoreFailure { /** * Failure due to a feature not supported by the current client/backend. */ - object FeatureNotSupported : NetworkFailure() + data object FeatureNotSupported : NetworkFailure() } interface MLSFailure : CoreFailure { - object WrongEpoch : MLSFailure + data object WrongEpoch : MLSFailure - object DuplicateMessage : MLSFailure + data object DuplicateMessage : MLSFailure - object BufferedFutureMessage : MLSFailure + data object BufferedFutureMessage : MLSFailure - object SelfCommitIgnored : MLSFailure + data object SelfCommitIgnored : MLSFailure - object UnmergedPendingGroup : MLSFailure + data object UnmergedPendingGroup : MLSFailure - object ConversationAlreadyExists : MLSFailure + data object ConversationAlreadyExists : MLSFailure - object ConversationDoesNotSupportMLS : MLSFailure + data object ConversationDoesNotSupportMLS : MLSFailure class Generic(internal val exception: Exception) : MLSFailure { val rootCause: Throwable get() = exception @@ -199,13 +199,13 @@ class ProteusFailure(internal val proteusException: ProteusException) : CoreFail } sealed class EncryptionFailure : CoreFailure.FeatureFailure() { - object GenericEncryptionError : EncryptionFailure() - object GenericDecryptionError : EncryptionFailure() - object WrongAssetHash : EncryptionFailure() + data object GenericEncryptionError : EncryptionFailure() + data object GenericDecryptionError : EncryptionFailure() + data object WrongAssetHash : EncryptionFailure() } sealed class StorageFailure : CoreFailure { - object DataNotFound : StorageFailure() + data object DataNotFound : StorageFailure() data class Generic(val rootCause: Throwable) : StorageFailure() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/FileSharingStatus.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/FileSharingStatus.kt index 1553c5838bb..5ffec8ef75f 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/FileSharingStatus.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/FileSharingStatus.kt @@ -23,8 +23,8 @@ data class FileSharingStatus( val isStatusChanged: Boolean? ) { sealed interface Value { - object Disabled : Value - object EnabledAll : Value + data object Disabled : Value + data object EnabledAll : Value data class EnabledSome(val allowedType: List) : Value } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/Conversation.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/Conversation.kt index a3160d3b713..9798f003631 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/Conversation.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/Conversation.kt @@ -208,7 +208,7 @@ data class Conversation( get() = type in setOf(Type.ONE_ON_ONE, Type.GROUP) sealed interface ProtocolInfo { - object Proteus : ProtocolInfo { + data object Proteus : ProtocolInfo { override fun name() = "Proteus" } @@ -247,8 +247,8 @@ data class Conversation( data class Member(val id: UserId, val role: Role) { sealed class Role { - object Member : Role() - object Admin : Role() + data object Member : Role() + data object Admin : Role() data class Unknown(val name: String) : Role() override fun toString(): String = diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationStatus.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationStatus.kt index 762882c7e60..3fff0ae7cf9 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationStatus.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationStatus.kt @@ -25,15 +25,15 @@ sealed class MutedConversationStatus(open val status: Int = 0) { /** * 0 -> All notifications are displayed */ - object AllAllowed : MutedConversationStatus(0) + data object AllAllowed : MutedConversationStatus(0) /** * 1 -> Only mentions and replies are displayed (normal messages muted) */ - object OnlyMentionsAndRepliesAllowed : MutedConversationStatus(1) + data object OnlyMentionsAndRepliesAllowed : MutedConversationStatus(1) /** * 3 -> No notifications are displayed */ - object AllMuted : MutedConversationStatus(3) + data object AllMuted : MutedConversationStatus(3) } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/Message.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/Message.kt index d8c764d94ef..4b89a83188a 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/Message.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/Message.kt @@ -407,7 +407,7 @@ sealed interface Message { } sealed class EditStatus { - object NotEdited : EditStatus() + data object NotEdited : EditStatus() data class Edited(val lastTimeStamp: String) : EditStatus() override fun toString(): String = when (this) { @@ -438,7 +438,7 @@ sealed interface Message { ) { sealed class SelfDeletionStatus { - object NotStarted : SelfDeletionStatus() + data object NotStarted : SelfDeletionStatus() data class Started(val selfDeletionStartDate: Instant) : SelfDeletionStatus() @@ -599,7 +599,7 @@ sealed class DeliveryStatus { val recipientsFailedDelivery: List ) : DeliveryStatus() - object CompleteDelivery : DeliveryStatus() + data object CompleteDelivery : DeliveryStatus() fun toLogMap(): Map = when (this) { is PartialDelivery -> mutableMapOf( diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageContent.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageContent.kt index 4a5523fb94a..d23d616c4ca 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageContent.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageContent.kt @@ -136,9 +136,9 @@ sealed class MessageContent { val assetMimeType: String ) : Content - object Deleted : Content + data object Deleted : Content - object Invalid : Content + data object Invalid : Content } data class Asset(val value: AssetContent) : Regular() @@ -245,7 +245,7 @@ sealed class MessageContent { data class TeamMemberRemoved(val userName: String) : System() - object MissedCall : System() + data object MissedCall : System() data class Reaction( val messageId: String, @@ -279,7 +279,7 @@ sealed class MessageContent { ) : System() // we can add other types to be processed, but signaling ones shouldn't be persisted - object Ignored : Signaling() // messages that aren't processed in any way + data object Ignored : Signaling() // messages that aren't processed in any way data class FailedDecryption( val encodedData: ByteArray? = null, @@ -288,16 +288,16 @@ sealed class MessageContent { val clientId: ClientId? = null ) : Regular() - object MLSWrongEpochWarning : System() + data object MLSWrongEpochWarning : System() - object ClientAction : Signaling() + data object ClientAction : Signaling() - object CryptoSessionReset : System() + data object CryptoSessionReset : System() - object HistoryLostProtocolChanged : System() + data object HistoryLostProtocolChanged : System() - object HistoryLost : System() - object ConversationCreated : System() + data object HistoryLost : System() + data object ConversationCreated : System() data object ConversationDegradedMLS : System() data object ConversationVerifiedMLS : System() data object ConversationDegradedProteus : System() @@ -420,8 +420,8 @@ sealed interface MessagePreviewContent { val otherUserIdList: List ) : MessagePreviewContent - object CryptoSessionReset : MessagePreviewContent + data object CryptoSessionReset : MessagePreviewContent - object Unknown : MessagePreviewContent + data object Unknown : MessagePreviewContent } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/publicuser/SearchUserRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/publicuser/SearchUserRepository.kt index 1c7b72d7970..a3886937ecd 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/publicuser/SearchUserRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/publicuser/SearchUserRepository.kt @@ -82,7 +82,7 @@ data class SearchUsersOptions( } sealed class ConversationMemberExcludedOptions { - object None : ConversationMemberExcludedOptions() + data object None : ConversationMemberExcludedOptions() data class ConversationExcluded(val conversationId: QualifiedID) : ConversationMemberExcludedOptions() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/sync/IncrementalSyncStatus.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/sync/IncrementalSyncStatus.kt index b8e6303c3aa..8e82ab0deaf 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/sync/IncrementalSyncStatus.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/sync/IncrementalSyncStatus.kt @@ -22,15 +22,15 @@ import com.wire.kalium.logic.CoreFailure sealed interface IncrementalSyncStatus { - object Pending : IncrementalSyncStatus { + data object Pending : IncrementalSyncStatus { override fun toString(): String = "PENDING" } - object FetchingPendingEvents : IncrementalSyncStatus { + data object FetchingPendingEvents : IncrementalSyncStatus { override fun toString() = "FETCHING_PENDING_EVENTS" } - object Live : IncrementalSyncStatus { + data object Live : IncrementalSyncStatus { override fun toString() = "LIVE" } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/sync/SlowSyncStatus.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/sync/SlowSyncStatus.kt index 59603aeddf8..6f8292bff1e 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/sync/SlowSyncStatus.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/sync/SlowSyncStatus.kt @@ -22,9 +22,9 @@ import com.wire.kalium.logic.CoreFailure sealed interface SlowSyncStatus { - object Pending : SlowSyncStatus + data object Pending : SlowSyncStatus - object Complete : SlowSyncStatus + data object Complete : SlowSyncStatus data class Ongoing(val currentStep: SlowSyncStep) : SlowSyncStatus diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/sync/SyncState.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/sync/SyncState.kt index 69cb71a57c0..7a555604978 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/sync/SyncState.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/sync/SyncState.kt @@ -25,7 +25,7 @@ sealed class SyncState { /** * Sync hasn't started yet. */ - object Waiting : SyncState() + data object Waiting : SyncState() /** * Fetching all initial data: @@ -37,19 +37,19 @@ sealed class SyncState { * - All team members (if user belongs to a team) * - Details of all other users discovered in past steps */ - object SlowSync : SyncState() + data object SlowSync : SyncState() /** * Is fetching events lost while this client was offline. * Implies that [SlowSync] is done. */ - object GatheringPendingEvents : SyncState() + data object GatheringPendingEvents : SyncState() /** * Is processing events, connected to the server and receiving real-time events. * This implies that [GatheringPendingEvents] is done. */ - object Live : SyncState() + data object Live : SyncState() /** * Sync was not completed due to a failure. diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/web/WebEventContent.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/web/WebEventContent.kt index b752f6cc57a..d5fe603c3c2 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/web/WebEventContent.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/web/WebEventContent.kt @@ -109,7 +109,7 @@ sealed class WebEventContent { @Serializable @SerialName("unknown") - object Unknown : WebEventContent() + data object Unknown : WebEventContent() } @Serializable diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/failure/ServerConfigFailure.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/failure/ServerConfigFailure.kt index 01e811436fe..49722d17df7 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/failure/ServerConfigFailure.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/failure/ServerConfigFailure.kt @@ -21,6 +21,6 @@ package com.wire.kalium.logic.failure import com.wire.kalium.logic.CoreFailure sealed class ServerConfigFailure : CoreFailure.FeatureFailure() { - object UnknownServerVersion : ServerConfigFailure() - object NewServerVersion : ServerConfigFailure() + data object UnknownServerVersion : ServerConfigFailure() + data object NewServerVersion : ServerConfigFailure() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/UpdateAssetMessageDownloadStatusUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/UpdateAssetMessageDownloadStatusUseCase.kt index 5f03e808395..cf24c845b83 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/UpdateAssetMessageDownloadStatusUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/UpdateAssetMessageDownloadStatusUseCase.kt @@ -59,6 +59,6 @@ class UpdateAssetMessageDownloadStatusUseCaseImpl( } sealed class UpdateDownloadStatusResult { - object Success : UpdateDownloadStatusResult() + data object Success : UpdateDownloadStatusResult() data class Failure(val coreFailure: CoreFailure) : UpdateDownloadStatusResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/UpdateAssetMessageUploadStatusUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/UpdateAssetMessageUploadStatusUseCase.kt index d35144c02ca..d3dfd257ba5 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/UpdateAssetMessageUploadStatusUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/UpdateAssetMessageUploadStatusUseCase.kt @@ -59,6 +59,6 @@ internal class UpdateAssetMessageUploadStatusUseCaseImpl( } sealed class UpdateUploadStatusResult { - object Success : UpdateUploadStatusResult() + data object Success : UpdateUploadStatusResult() data class Failure(val coreFailure: CoreFailure) : UpdateUploadStatusResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/AddAuthenticatedUserUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/AddAuthenticatedUserUseCase.kt index ef23072c578..4d7626fa083 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/AddAuthenticatedUserUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/AddAuthenticatedUserUseCase.kt @@ -38,7 +38,7 @@ class AddAuthenticatedUserUseCase internal constructor( sealed class Result { data class Success(val userId: UserId) : Result() sealed class Failure : Result() { - object UserAlreadyExists : Failure() + data object UserAlreadyExists : Failure() data class Generic(val genericFailure: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/LoginUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/LoginUseCase.kt index 4fe55e73032..2d2886a2e24 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/LoginUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/LoginUseCase.kt @@ -44,28 +44,28 @@ sealed class AuthenticationResult { ) : AuthenticationResult() sealed class Failure : AuthenticationResult() { - object SocketError : Failure() + data object SocketError : Failure() sealed class InvalidCredentials : Failure() { /** * The team has enabled 2FA but the user has not entered it yet */ - object Missing2FA : InvalidCredentials() + data object Missing2FA : InvalidCredentials() /** * The user has entered an invalid 2FA code, or the 2FA code has expired */ - object Invalid2FA : InvalidCredentials() + data object Invalid2FA : InvalidCredentials() /** * The user has entered an invalid email/handle or password combination */ - object InvalidPasswordIdentityCombination : InvalidCredentials() + data object InvalidPasswordIdentityCombination : InvalidCredentials() } /** * The user has entered a text that isn't considered a valid email or handle */ - object InvalidUserIdentifier : Failure() + data object InvalidUserIdentifier : Failure() data class Generic(val genericFailure: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/autoVersioningAuth/AutoVersionAuthScopeUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/autoVersioningAuth/AutoVersionAuthScopeUseCase.kt index 128b8a0084f..ad5fad6e22d 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/autoVersioningAuth/AutoVersionAuthScopeUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/autoVersioningAuth/AutoVersionAuthScopeUseCase.kt @@ -68,15 +68,15 @@ class AutoVersionAuthScopeUseCase( class Success(val authenticationScope: AuthenticationScope) : Result() sealed class Failure : Result() { - object UnknownServerVersion : Failure() - object TooNewVersion : Failure() + data object UnknownServerVersion : Failure() + data object TooNewVersion : Failure() data class Generic(val genericFailure: CoreFailure) : Failure() } } sealed interface ProxyAuthentication { - object None : ProxyAuthentication + data object None : ProxyAuthentication - class UsernameAndPassword(val proxyCredentials: ProxyCredentials) : ProxyAuthentication + data class UsernameAndPassword(val proxyCredentials: ProxyCredentials) : ProxyAuthentication } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/GetSSOLoginSessionUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/GetSSOLoginSessionUseCase.kt index d0488f0d772..ca3aa6afd6d 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/GetSSOLoginSessionUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/GetSSOLoginSessionUseCase.kt @@ -39,7 +39,7 @@ sealed class SSOLoginSessionResult { ) : SSOLoginSessionResult() sealed class Failure : SSOLoginSessionResult() { - object InvalidCookie : Failure() + data object InvalidCookie : Failure() data class Generic(val genericFailure: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/SSOFinalizeLoginUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/SSOFinalizeLoginUseCase.kt index 2af5216867a..fc07d70d29d 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/SSOFinalizeLoginUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/SSOFinalizeLoginUseCase.kt @@ -29,7 +29,7 @@ sealed class SSOFinalizeLoginResult { data class Success(val requestUrl: String) : SSOFinalizeLoginResult() sealed class Failure : SSOFinalizeLoginResult() { - object InvalidCookie : SSOFinalizeLoginResult.Failure() + data object InvalidCookie : SSOFinalizeLoginResult.Failure() data class Generic(val genericFailure: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/SSOInitiateLoginUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/SSOInitiateLoginUseCase.kt index 4a9decd1b73..47365438d8a 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/SSOInitiateLoginUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/SSOInitiateLoginUseCase.kt @@ -31,9 +31,9 @@ sealed class SSOInitiateLoginResult { data class Success(val requestUrl: String) : SSOInitiateLoginResult() sealed class Failure : SSOInitiateLoginResult() { - object InvalidCodeFormat : Failure() - object InvalidCode : Failure() - object InvalidRedirect : Failure() + data object InvalidCodeFormat : Failure() + data object InvalidCode : Failure() + data object InvalidRedirect : Failure() data class Generic(val genericFailure: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/ValidateSSOCodeUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/ValidateSSOCodeUseCase.kt index a87c5e973b8..fbf5ba9e510 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/ValidateSSOCodeUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/ValidateSSOCodeUseCase.kt @@ -50,5 +50,5 @@ internal class ValidateSSOCodeUseCaseImpl : ValidateSSOCodeUseCase { sealed class ValidateSSOCodeResult { data class Valid(val uuid: String) : ValidateSSOCodeResult() - object Invalid : ValidateSSOCodeResult() + data object Invalid : ValidateSSOCodeResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/verification/RequestSecondFactorVerificationCodeUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/verification/RequestSecondFactorVerificationCodeUseCase.kt index 1c177414f3f..acf5b04c8aa 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/verification/RequestSecondFactorVerificationCodeUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/verification/RequestSecondFactorVerificationCodeUseCase.kt @@ -69,7 +69,7 @@ class RequestSecondFactorVerificationCodeUseCase( }) interface Result { - object Success : Result + data object Success : Result interface Failure : Result { data class Generic(val cause: CoreFailure) : Result @@ -80,7 +80,7 @@ class RequestSecondFactorVerificationCodeUseCase( * From a UI point of view, you might be able to proceed and request * the 2FA code to the user anyway */ - object TooManyRequests : Result + data object TooManyRequests : Result } } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupResult.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupResult.kt index 5fa5abe35e2..ee196640970 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupResult.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupResult.kt @@ -19,11 +19,11 @@ package com.wire.kalium.logic.feature.backup sealed class RestoreBackupResult { data class Failure(val failure: BackupRestoreFailure) : RestoreBackupResult() - object Success : RestoreBackupResult() + data object Success : RestoreBackupResult() sealed class BackupRestoreFailure(open val cause: String) { - object InvalidPassword : BackupRestoreFailure("The provided password is invalid") - object InvalidUserId : BackupRestoreFailure("User id in the backup file does not match the current user id") + data object InvalidPassword : BackupRestoreFailure("The provided password is invalid") + data object InvalidUserId : BackupRestoreFailure("User id in the backup file does not match the current user id") data class IncompatibleBackup(override val cause: String) : BackupRestoreFailure(cause) data class BackupIOFailure(override val cause: String) : BackupRestoreFailure(cause) data class DecryptionFailure(override val cause: String) : BackupRestoreFailure(cause) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/VerifyBackupUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/VerifyBackupUseCase.kt index 4b5ce273475..52db41dda4d 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/VerifyBackupUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/VerifyBackupUseCase.kt @@ -68,13 +68,13 @@ internal class VerifyBackupUseCaseImpl( sealed class VerifyBackupResult { sealed class Success : VerifyBackupResult() { - object Encrypted : Success() - object NotEncrypted : Success() - object Web : Success() + data object Encrypted : Success() + data object NotEncrypted : Success() + data object Web : Success() } sealed class Failure : VerifyBackupResult() { - object InvalidBackupFile : Failure() + data object InvalidBackupFile : Failure() data class Generic(val error: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/IsEligibleToStartCallUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/IsEligibleToStartCallUseCase.kt index 7855afd8e6e..c3b68714b42 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/IsEligibleToStartCallUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/IsEligibleToStartCallUseCase.kt @@ -77,7 +77,7 @@ sealed interface ConferenceCallingResult { /** * Eligible to start conference/one on one calls */ - object Enabled : ConferenceCallingResult + data object Enabled : ConferenceCallingResult /** * Not eligible to start a conference/one on one calls @@ -86,16 +86,16 @@ sealed interface ConferenceCallingResult { /** * Established call is ongoing */ - object Established : Disabled + data object Established : Disabled /** * There is an Ongoing Call */ - object OngoingCall : Disabled + data object OngoingCall : Disabled /** * Conference Calling is unavailable due to team not having the paid plan */ - object Unavailable : Disabled + data object Unavailable : Disabled } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/StartCallUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/StartCallUseCase.kt index 8772e1e671d..347ea20540f 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/StartCallUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/StartCallUseCase.kt @@ -73,11 +73,11 @@ class StartCallUseCase internal constructor( /** * Call started successfully */ - object Success : Result + data object Success : Result /** * Failed to start a call as Sync is not yet performed */ - object SyncFailure : Result + data object SyncFailure : Result } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/DeleteClientUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/DeleteClientUseCase.kt index fda4033b4e7..159f285ad99 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/DeleteClientUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/DeleteClientUseCase.kt @@ -70,11 +70,11 @@ internal class DeleteClientUseCaseImpl( } sealed class DeleteClientResult { - object Success : DeleteClientResult() + data object Success : DeleteClientResult() sealed class Failure : DeleteClientResult() { - object InvalidCredentials : Failure() - object PasswordAuthRequired : Failure() + data object InvalidCredentials : Failure() + data object PasswordAuthRequired : Failure() data class Generic(val genericFailure: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ObserveNewClientsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ObserveNewClientsUseCase.kt index d3dcdfbdc8a..df3a9f174c1 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ObserveNewClientsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ObserveNewClientsUseCase.kt @@ -107,8 +107,8 @@ class ObserveNewClientsUseCaseImpl internal constructor( } sealed class NewClientResult { - object Error : NewClientResult() - object Empty : NewClientResult() + data object Error : NewClientResult() + data object Empty : NewClientResult() data class InCurrentAccount(val newClients: List, val userId: UserId) : NewClientResult() data class InOtherAccount( val newClients: List, diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/RegisterClientUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/RegisterClientUseCase.kt index 30039435e83..55dec41f5fc 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/RegisterClientUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/RegisterClientUseCase.kt @@ -59,21 +59,21 @@ sealed class RegisterClientResult { /** * The team has enabled 2FA but has not provided a 2FA code. */ - object Missing2FA : InvalidCredentials() + data object Missing2FA : InvalidCredentials() /** * The team has enabled 2FA but the user has provided an invalid or expired 2FA code. */ - object Invalid2FA : InvalidCredentials() + data object Invalid2FA : InvalidCredentials() /** * The password is invalid. */ - object InvalidPassword : InvalidCredentials() + data object InvalidPassword : InvalidCredentials() } - object TooManyClients : Failure() - object PasswordAuthRequired : Failure() + data object TooManyClients : Failure() + data object PasswordAuthRequired : Failure() data class Generic(val genericFailure: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/UpdateClientVerificationStatusUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/UpdateClientVerificationStatusUseCase.kt index 866fdbef99c..df47865280f 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/UpdateClientVerificationStatusUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/UpdateClientVerificationStatusUseCase.kt @@ -41,7 +41,7 @@ class UpdateClientVerificationStatusUseCase internal constructor( ) sealed interface Result { - object Success : Result + data object Success : Result data class Failure(val error: StorageFailure) : Result } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/VerifyExistingClientUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/VerifyExistingClientUseCase.kt index 679a3ed01c5..87cecb7d4c1 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/VerifyExistingClientUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/VerifyExistingClientUseCase.kt @@ -56,10 +56,10 @@ internal class VerifyExistingClientUseCaseImpl( } sealed class VerifyExistingClientResult { - class Success(val client: Client) : VerifyExistingClientResult() + data class Success(val client: Client) : VerifyExistingClientResult() sealed class Failure : VerifyExistingClientResult() { - object ClientNotRegistered : Failure() + data object ClientNotRegistered : Failure() data class Generic(val genericFailure: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/AcceptConnectionRequestUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/AcceptConnectionRequestUseCase.kt index 8d60f87aced..7b332ac47f3 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/AcceptConnectionRequestUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/AcceptConnectionRequestUseCase.kt @@ -74,6 +74,6 @@ internal class AcceptConnectionRequestUseCaseImpl( } sealed class AcceptConnectionRequestUseCaseResult { - object Success : AcceptConnectionRequestUseCaseResult() - class Failure(val coreFailure: CoreFailure) : AcceptConnectionRequestUseCaseResult() + data object Success : AcceptConnectionRequestUseCaseResult() + data class Failure(val coreFailure: CoreFailure) : AcceptConnectionRequestUseCaseResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/BlockUserUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/BlockUserUseCase.kt index d9b441df751..0366b55f420 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/BlockUserUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/BlockUserUseCase.kt @@ -54,6 +54,6 @@ internal class BlockUserUseCaseImpl( } sealed class BlockUserResult { - object Success : BlockUserResult() - class Failure(val coreFailure: CoreFailure) : BlockUserResult() + data object Success : BlockUserResult() + data class Failure(val coreFailure: CoreFailure) : BlockUserResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/CancelConnectionRequestUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/CancelConnectionRequestUseCase.kt index c930aedc969..6cecdafa8e2 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/CancelConnectionRequestUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/CancelConnectionRequestUseCase.kt @@ -56,6 +56,6 @@ internal class CancelConnectionRequestUseCaseImpl( } sealed class CancelConnectionRequestUseCaseResult { - object Success : CancelConnectionRequestUseCaseResult() - class Failure(val coreFailure: CoreFailure) : CancelConnectionRequestUseCaseResult() + data object Success : CancelConnectionRequestUseCaseResult() + data class Failure(val coreFailure: CoreFailure) : CancelConnectionRequestUseCaseResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/IgnoreConnectionRequestUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/IgnoreConnectionRequestUseCase.kt index c5f40316103..46bf6095068 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/IgnoreConnectionRequestUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/IgnoreConnectionRequestUseCase.kt @@ -54,6 +54,6 @@ internal class IgnoreConnectionRequestUseCaseImpl( } sealed class IgnoreConnectionRequestUseCaseResult { - object Success : IgnoreConnectionRequestUseCaseResult() - class Failure(val coreFailure: CoreFailure) : IgnoreConnectionRequestUseCaseResult() + data object Success : IgnoreConnectionRequestUseCaseResult() + data class Failure(val coreFailure: CoreFailure) : IgnoreConnectionRequestUseCaseResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/UnblockUserUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/UnblockUserUseCase.kt index 02482f3eacb..a30f9ff8e1e 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/UnblockUserUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/connection/UnblockUserUseCase.kt @@ -53,6 +53,6 @@ internal class UnblockUserUseCaseImpl( } sealed class UnblockUserResult { - object Success : UnblockUserResult() - class Failure(val coreFailure: CoreFailure) : UnblockUserResult() + data object Success : UnblockUserResult() + data class Failure(val coreFailure: CoreFailure) : UnblockUserResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/AddMemberToConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/AddMemberToConversationUseCase.kt index 261ee4f68d9..d9601951779 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/AddMemberToConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/AddMemberToConversationUseCase.kt @@ -36,7 +36,7 @@ interface AddMemberToConversationUseCase { suspend operator fun invoke(conversationId: ConversationId, userIdList: List): Result sealed interface Result { - object Success : Result + data object Success : Result data class Failure(val cause: CoreFailure) : Result } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/AddServiceToConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/AddServiceToConversationUseCase.kt index 1439b8197bb..1b45d609d98 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/AddServiceToConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/AddServiceToConversationUseCase.kt @@ -38,7 +38,7 @@ class AddServiceToConversationUseCase internal constructor( ): Result = groupRepository.addService(serviceId, conversationId).fold(Result::Failure, { Result.Success }) sealed interface Result { - object Success : Result + data object Success : Result data class Failure(val cause: CoreFailure) : Result } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ClearConversationContentUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ClearConversationContentUseCase.kt index 6839f8e2f4b..63c24c21b97 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ClearConversationContentUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ClearConversationContentUseCase.kt @@ -43,8 +43,8 @@ interface ClearConversationContentUseCase { suspend operator fun invoke(conversationId: ConversationId): Result sealed class Result { - object Success : Result() - object Failure : Result() + data object Success : Result() + data object Failure : Result() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/CreateGroupConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/CreateGroupConversationUseCase.kt index 1f629bc68cb..d4613c342a1 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/CreateGroupConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/CreateGroupConversationUseCase.kt @@ -95,7 +95,7 @@ class CreateGroupConversationUseCase internal constructor( /** * There was a failure trying to Sync with the server */ - object SyncFailure : Result + data object SyncFailure : Result /** * Other, unknown failure. diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/GetOneToOneConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/GetOneToOneConversationUseCase.kt index b5b581ff572..3cb4cabac04 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/GetOneToOneConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/GetOneToOneConversationUseCase.kt @@ -47,7 +47,7 @@ class GetOneToOneConversationUseCase internal constructor( sealed class Result { data class Success(val conversation: Conversation) : Result() - object Failure : Result() + data object Failure : Result() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RecoverMLSConversationsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RecoverMLSConversationsUseCase.kt index 81c4690fe6c..ff61f78481b 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RecoverMLSConversationsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RecoverMLSConversationsUseCase.kt @@ -34,8 +34,8 @@ import com.wire.kalium.logic.functional.onFailure import com.wire.kalium.logic.kaliumLogger sealed class RecoverMLSConversationsResult { - object Success : RecoverMLSConversationsResult() - class Failure(val failure: CoreFailure) : RecoverMLSConversationsResult() + data object Success : RecoverMLSConversationsResult() + data class Failure(val failure: CoreFailure) : RecoverMLSConversationsResult() } /** diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RemoveMemberFromConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RemoveMemberFromConversationUseCase.kt index 8a05f78695f..1096f065969 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RemoveMemberFromConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RemoveMemberFromConversationUseCase.kt @@ -36,7 +36,7 @@ interface RemoveMemberFromConversationUseCase { */ suspend operator fun invoke(conversationId: ConversationId, userIdToRemove: UserId): Result sealed interface Result { - object Success : Result + data object Success : Result data class Failure(val cause: CoreFailure) : Result } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RenameConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RenameConversationUseCase.kt index 862cf2277e1..28f660f811e 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RenameConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RenameConversationUseCase.kt @@ -66,6 +66,6 @@ internal class RenameConversationUseCaseImpl( } sealed class RenamingResult { - object Success : RenamingResult() + data object Success : RenamingResult() data class Failure(val coreFailure: CoreFailure) : RenamingResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationAccessRoleUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationAccessRoleUseCase.kt index 650689d0548..59b0c790e0d 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationAccessRoleUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationAccessRoleUseCase.kt @@ -79,7 +79,7 @@ class UpdateConversationAccessRoleUseCase internal constructor( } sealed interface Result { - object Success : Result + data object Success : Result data class Failure(val cause: CoreFailure) : Result } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationArchivedStatusUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationArchivedStatusUseCase.kt index 2ccd979b3dc..12645b19a13 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationArchivedStatusUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationArchivedStatusUseCase.kt @@ -90,6 +90,6 @@ internal class UpdateConversationArchivedStatusUseCaseImpl( } sealed class ArchiveStatusUpdateResult { - object Success : ArchiveStatusUpdateResult() - object Failure : ArchiveStatusUpdateResult() + data object Success : ArchiveStatusUpdateResult() + data object Failure : ArchiveStatusUpdateResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationMemberRoleUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationMemberRoleUseCase.kt index 413edf4399e..6bc6538c94a 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationMemberRoleUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationMemberRoleUseCase.kt @@ -63,6 +63,6 @@ internal class UpdateConversationMemberRoleUseCaseImpl( } sealed class UpdateConversationMemberRoleResult { - object Success : UpdateConversationMemberRoleResult() - object Failure : UpdateConversationMemberRoleResult() + data object Success : UpdateConversationMemberRoleResult() + data object Failure : UpdateConversationMemberRoleResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationMutedStatusUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationMutedStatusUseCase.kt index 09293962417..5e7abf51664 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationMutedStatusUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationMutedStatusUseCase.kt @@ -65,6 +65,6 @@ internal class UpdateConversationMutedStatusUseCaseImpl( } sealed class ConversationUpdateStatusResult { - object Success : ConversationUpdateStatusResult() - object Failure : ConversationUpdateStatusResult() + data object Success : ConversationUpdateStatusResult() + data object Failure : ConversationUpdateStatusResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationReceiptModeUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationReceiptModeUseCase.kt index 38b4e2b7f0b..7552e779f17 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationReceiptModeUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationReceiptModeUseCase.kt @@ -87,6 +87,6 @@ internal class UpdateConversationReceiptModeUseCaseImpl( } sealed interface ConversationUpdateReceiptModeResult { - object Success : ConversationUpdateReceiptModeResult + data object Success : ConversationUpdateReceiptModeResult data class Failure(val cause: CoreFailure) : ConversationUpdateReceiptModeResult } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/guestroomlink/RevokeGuestRoomLinkUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/guestroomlink/RevokeGuestRoomLinkUseCase.kt index a0ce35ee0d1..4cb6b011f8c 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/guestroomlink/RevokeGuestRoomLinkUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/guestroomlink/RevokeGuestRoomLinkUseCase.kt @@ -40,6 +40,6 @@ class RevokeGuestRoomLinkUseCaseImpl internal constructor( } sealed interface RevokeGuestRoomLinkResult { - object Success : RevokeGuestRoomLinkResult + data object Success : RevokeGuestRoomLinkResult data class Failure(val cause: CoreFailure) : RevokeGuestRoomLinkResult } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/keyingmaterials/UpdateKeyingMaterialsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/keyingmaterials/UpdateKeyingMaterialsUseCase.kt index ac22a35d601..c594ab28633 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/keyingmaterials/UpdateKeyingMaterialsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/keyingmaterials/UpdateKeyingMaterialsUseCase.kt @@ -27,8 +27,8 @@ import com.wire.kalium.logic.functional.foldToEitherWhileRight sealed class UpdateKeyingMaterialsResult { - object Success : UpdateKeyingMaterialsResult() - class Failure(val failure: CoreFailure) : UpdateKeyingMaterialsResult() + data object Success : UpdateKeyingMaterialsResult() + data class Failure(val failure: CoreFailure) : UpdateKeyingMaterialsResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/messagetimer/UpdateMessageTimerUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/messagetimer/UpdateMessageTimerUseCase.kt index 6cb2f7b53b0..29a172e8a41 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/messagetimer/UpdateMessageTimerUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/messagetimer/UpdateMessageTimerUseCase.kt @@ -29,7 +29,7 @@ interface UpdateMessageTimerUseCase { suspend operator fun invoke(conversationId: ConversationId, messageTimer: Long?): Result sealed interface Result { - object Success : Result + data object Success : Result data class Failure(val cause: CoreFailure) : Result } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/BreakSessionUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/BreakSessionUseCase.kt index 4b745d0bc1c..f5a9f92d286 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/BreakSessionUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/BreakSessionUseCase.kt @@ -75,6 +75,6 @@ internal class BreakSessionUseCaseImpl internal constructor( } sealed class BreakSessionResult { - object Success : BreakSessionResult() + data object Success : BreakSessionResult() data class Failure(val coreFailure: CoreFailure) : BreakSessionResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/SendBrokenAssetMessageUseCaseImpl.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/SendBrokenAssetMessageUseCaseImpl.kt index b1cf6e6f2ac..5cb30a6fad9 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/SendBrokenAssetMessageUseCaseImpl.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/SendBrokenAssetMessageUseCaseImpl.kt @@ -213,8 +213,8 @@ internal class SendBrokenAssetMessageUseCaseImpl( } sealed class SendBrokenAssetMessageResult { - object Success : SendBrokenAssetMessageResult() - class Failure(val coreFailure: CoreFailure) : SendBrokenAssetMessageResult() + data object Success : SendBrokenAssetMessageResult() + data class Failure(val coreFailure: CoreFailure) : SendBrokenAssetMessageResult() } private data class AssetMessageMetadata( diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCase.kt index b55c4c18e24..30f7991898c 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCase.kt @@ -29,8 +29,8 @@ import com.wire.kalium.logic.kaliumLogger sealed class RefillKeyPackagesResult { - object Success : RefillKeyPackagesResult() - class Failure(val failure: CoreFailure) : RefillKeyPackagesResult() + data object Success : RefillKeyPackagesResult() + data class Failure(val failure: CoreFailure) : RefillKeyPackagesResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/BroadcastMessageOption.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/BroadcastMessageOption.kt index 7cb8f1044de..e56a2563b6a 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/BroadcastMessageOption.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/BroadcastMessageOption.kt @@ -20,8 +20,8 @@ package com.wire.kalium.logic.feature.message import com.wire.kalium.logic.data.user.UserId sealed class BroadcastMessageOption { - object IgnoreAll : BroadcastMessageOption() - object ReportAll : BroadcastMessageOption() + data object IgnoreAll : BroadcastMessageOption() + data object ReportAll : BroadcastMessageOption() data class IgnoreSome(val userIDs: List) : BroadcastMessageOption() data class ReportSome(val userIDs: List) : BroadcastMessageOption() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MarkMessagesAsNotifiedUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MarkMessagesAsNotifiedUseCase.kt index 37cd67999ae..e5713432330 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MarkMessagesAsNotifiedUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MarkMessagesAsNotifiedUseCase.kt @@ -60,7 +60,7 @@ class MarkMessagesAsNotifiedUseCase internal constructor( /** * All conversations should be marked as notified. */ - object AllConversations : UpdateTarget + data object AllConversations : UpdateTarget /** * A specific conversation, represented by its [conversationId], should be marked as notified @@ -70,6 +70,6 @@ class MarkMessagesAsNotifiedUseCase internal constructor( } sealed class Result { - object Success : Result() + data object Success : Result() data class Failure(val storageFailure: StorageFailure) : Result() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/composite/SendButtonActionMessageUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/composite/SendButtonActionMessageUseCase.kt index 100f1df940e..7c18c2a2e42 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/composite/SendButtonActionMessageUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/composite/SendButtonActionMessageUseCase.kt @@ -77,7 +77,7 @@ class SendButtonActionMessageUseCase internal constructor( }.fold(Result::Failure, { Result.Success }) sealed interface Result { - object Success : Result + data object Success : Result data class Failure( val error: CoreFailure ) : Result diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/notificationToken/SaveNotificationTokenUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/notificationToken/SaveNotificationTokenUseCase.kt index c2b723fcc2e..4df8a196ce1 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/notificationToken/SaveNotificationTokenUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/notificationToken/SaveNotificationTokenUseCase.kt @@ -66,8 +66,8 @@ internal class SaveNotificationTokenUseCaseImpl( } sealed class Result { - object Success : Result() + data object Success : Result() sealed class Failure : Result() { - class Generic(val failure: StorageFailure) : Failure() + data class Generic(val failure: StorageFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/publicuser/search/SearchUsersResult.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/publicuser/search/SearchUsersResult.kt index 758e1bff1cf..0a83d995c17 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/publicuser/search/SearchUsersResult.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/publicuser/search/SearchUsersResult.kt @@ -24,8 +24,8 @@ import com.wire.kalium.logic.data.publicuser.model.UserSearchResult sealed class SearchUsersResult { data class Success(val userSearchResult: UserSearchResult) : SearchUsersResult() sealed class Failure : SearchUsersResult() { - object InvalidQuery : Failure() - object InvalidRequest : Failure() + data object InvalidQuery : Failure() + data object InvalidRequest : Failure() data class Generic(val genericFailure: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/RegisterAccountUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/RegisterAccountUseCase.kt index bceb8a7096e..b3de31c9763 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/RegisterAccountUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/RegisterAccountUseCase.kt @@ -145,13 +145,13 @@ sealed class RegisterResult { ) : RegisterResult() sealed class Failure : RegisterResult() { - object EmailDomainBlocked : Failure() - object AccountAlreadyExists : Failure() - object InvalidActivationCode : Failure() - object UserCreationRestricted : Failure() - object TeamMembersLimitReached : Failure() - object BlackListed : Failure() - object InvalidEmail : Failure() - class Generic(val failure: CoreFailure) : Failure() + data object EmailDomainBlocked : Failure() + data object AccountAlreadyExists : Failure() + data object InvalidActivationCode : Failure() + data object UserCreationRestricted : Failure() + data object TeamMembersLimitReached : Failure() + data object BlackListed : Failure() + data object InvalidEmail : Failure() + data class Generic(val failure: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/RequestActivationCodeUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/RequestActivationCodeUseCase.kt index 1c1c424c845..24dc7a637cf 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/RequestActivationCodeUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/RequestActivationCodeUseCase.kt @@ -57,12 +57,12 @@ class RequestActivationCodeUseCase internal constructor( } sealed class RequestActivationCodeResult { - object Success : RequestActivationCodeResult() + data object Success : RequestActivationCodeResult() sealed class Failure : RequestActivationCodeResult() { - object InvalidEmail : Failure() - object BlacklistedEmail : Failure() - object AlreadyInUse : Failure() - object DomainBlocked : Failure() - class Generic(val failure: NetworkFailure) : Failure() + data object InvalidEmail : Failure() + data object BlacklistedEmail : Failure() + data object AlreadyInUse : Failure() + data object DomainBlocked : Failure() + data class Generic(val failure: NetworkFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/VerifyActivationCodeUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/VerifyActivationCodeUseCase.kt index 309d6eee999..d2a76296cde 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/VerifyActivationCodeUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/VerifyActivationCodeUseCase.kt @@ -54,9 +54,9 @@ class VerifyActivationCodeUseCase internal constructor( } sealed class VerifyActivationCodeResult { - object Success : VerifyActivationCodeResult() + data object Success : VerifyActivationCodeResult() sealed class Failure : VerifyActivationCodeResult() { - object InvalidCode : Failure() - class Generic(val failure: NetworkFailure) : Failure() + data object InvalidCode : Failure() + data class Generic(val failure: NetworkFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/rootDetection/CheckSystemIntegrityUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/rootDetection/CheckSystemIntegrityUseCase.kt index 729707ae2e0..ec3e624c772 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/rootDetection/CheckSystemIntegrityUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/rootDetection/CheckSystemIntegrityUseCase.kt @@ -39,8 +39,8 @@ import com.wire.kalium.logic.kaliumLogger interface CheckSystemIntegrityUseCase { sealed class Result { - object Success : Result() - object Failed : Result() + data object Success : Result() + data object Failed : Result() } suspend fun invoke(): Result diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/SelfDeletionTimer.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/SelfDeletionTimer.kt index 0e15e7f28f5..29086c4eec6 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/SelfDeletionTimer.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/SelfDeletionTimer.kt @@ -28,7 +28,7 @@ sealed interface SelfDeletionTimer { /** * Represents a self deletion timer that is currently disabled */ - object Disabled : SelfDeletionTimer { + data object Disabled : SelfDeletionTimer { override val duration: Duration? = null } @@ -99,8 +99,8 @@ data class TeamSettingsSelfDeletionStatus( ) sealed interface TeamSelfDeleteTimer { - object Disabled : TeamSelfDeleteTimer - object Enabled : TeamSelfDeleteTimer + data object Disabled : TeamSelfDeleteTimer + data object Enabled : TeamSelfDeleteTimer data class Enforced(val enforcedDuration: Duration) : TeamSelfDeleteTimer fun toLogMap(eventDescription: String): Map = mapOf( diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/server/FetchApiVersionUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/server/FetchApiVersionUseCase.kt index d8b2483c8ec..776d61c1094 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/server/FetchApiVersionUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/server/FetchApiVersionUseCase.kt @@ -57,8 +57,8 @@ sealed class FetchApiVersionResult { class Success(val serverConfig: ServerConfig) : FetchApiVersionResult() sealed class Failure : FetchApiVersionResult() { - object UnknownServerVersion : Failure() - object TooNewVersion : Failure() + data object UnknownServerVersion : Failure() + data object TooNewVersion : Failure() data class Generic(val genericFailure: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionUseCase.kt index 9aefbe4e579..3ddc3ae3cec 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionUseCase.kt @@ -28,7 +28,7 @@ sealed class CurrentSessionResult { data class Success(val accountInfo: AccountInfo) : CurrentSessionResult() sealed class Failure : CurrentSessionResult() { - object SessionNotFound : Failure() + data object SessionNotFound : Failure() @Suppress("UNUSED_PARAMETER") // It's used by consumers of Kalium class Generic(coreFailure: CoreFailure) : Failure() diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/DeleteSessionUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/DeleteSessionUseCase.kt index 4363ae8c63c..58a2eb0fcb2 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/DeleteSessionUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/DeleteSessionUseCase.kt @@ -44,7 +44,7 @@ class DeleteSessionUseCase internal constructor( }) sealed class Result { - object Success : Result() + data object Success : Result() data class Failure(val cause: StorageFailure) : Result() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/DeregisterTokenUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/DeregisterTokenUseCase.kt index ff278877efc..fff4cb020bc 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/DeregisterTokenUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/DeregisterTokenUseCase.kt @@ -34,9 +34,9 @@ interface DeregisterTokenUseCase { suspend operator fun invoke(): Result sealed class Result { - object Success : Result() + data object Success : Result() sealed class Failure : Result() { - object NotFound : Failure() + data object NotFound : Failure() data class Generic(val coreFailure: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/SessionResult.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/SessionResult.kt index 661bdc389a3..1d2f0620797 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/SessionResult.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/SessionResult.kt @@ -25,7 +25,7 @@ sealed class GetAllSessionsResult { class Success(val sessions: List) : GetAllSessionsResult() sealed class Failure : GetAllSessionsResult() { - object NoSessionFound : Failure() + data object NoSessionFound : Failure() data class Generic(val genericFailure: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/UpdateCurrentSessionUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/UpdateCurrentSessionUseCase.kt index 878abc7239f..9d1aec4e015 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/UpdateCurrentSessionUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/UpdateCurrentSessionUseCase.kt @@ -34,7 +34,7 @@ class UpdateCurrentSessionUseCase internal constructor(private val sessionReposi sessionRepository.updateCurrentSession(userId).fold({ Result.Failure(it) }, { Result.Success }) sealed class Result { - object Success : Result() + data object Success : Result() data class Failure(val cause: StorageFailure) : Result() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/sessionreset/ResetSessionUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/sessionreset/ResetSessionUseCase.kt index 3ad3ba43324..78e4c4f16c3 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/sessionreset/ResetSessionUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/sessionreset/ResetSessionUseCase.kt @@ -93,6 +93,6 @@ internal class ResetSessionUseCaseImpl internal constructor( } sealed class ResetSessionResult { - object Success : ResetSessionResult() + data object Success : ResetSessionResult() data class Failure(val coreFailure: CoreFailure) : ResetSessionResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/team/DeleteTeamConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/team/DeleteTeamConversationUseCase.kt index 5c752480b76..6b0feb7cec3 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/team/DeleteTeamConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/team/DeleteTeamConversationUseCase.kt @@ -62,10 +62,10 @@ internal class DeleteTeamConversationUseCaseImpl( } sealed class Result { - object Success : Result() + data object Success : Result() sealed class Failure : Result() { data class GenericFailure(val coreFailure: CoreFailure) : Failure() - object NoTeamFailure : Result() + data object NoTeamFailure : Result() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/DeleteAccountUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/DeleteAccountUseCase.kt index 67d4bb77107..5a2436def3f 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/DeleteAccountUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/DeleteAccountUseCase.kt @@ -32,7 +32,7 @@ class DeleteAccountUseCase internal constructor( .fold(Result::Failure, { Result.Success }) sealed class Result { - object Success : Result() + data object Success : Result() data class Failure(val networkFailure: NetworkFailure) : Result() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/GetUserInfoUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/GetUserInfoUseCase.kt index 22ed6de7704..2633a47cf0d 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/GetUserInfoUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/GetUserInfoUseCase.kt @@ -93,5 +93,5 @@ internal class GetUserInfoUseCaseImpl( sealed class GetUserInfoResult { class Success(val otherUser: OtherUser, val team: Team?) : GetUserInfoResult() - object Failure : GetUserInfoResult() + data object Failure : GetUserInfoResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/SetUserHandleUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/SetUserHandleUseCase.kt index 71d6dffcdad..7acd0fad68f 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/SetUserHandleUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/SetUserHandleUseCase.kt @@ -30,10 +30,10 @@ import com.wire.kalium.network.exceptions.isHandleExists import com.wire.kalium.network.exceptions.isInvalidHandle sealed class SetUserHandleResult { - object Success : SetUserHandleResult() + data object Success : SetUserHandleResult() sealed class Failure : SetUserHandleResult() { - object InvalidHandle : Failure() - object HandleExists : Failure() + data object InvalidHandle : Failure() + data object HandleExists : Failure() data class Generic(val error: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateDisplayNameUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateDisplayNameUseCase.kt index 7506c132fff..fc2ce4f62c5 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateDisplayNameUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateDisplayNameUseCase.kt @@ -50,6 +50,6 @@ internal class UpdateDisplayNameUseCaseImpl( } sealed class DisplayNameUpdateResult { - object Success : DisplayNameUpdateResult() + data object Success : DisplayNameUpdateResult() data class Failure(val coreFailure: CoreFailure) : DisplayNameUpdateResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateEmailUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateEmailUseCase.kt index ca9d38d4094..d5f9d92639c 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateEmailUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateEmailUseCase.kt @@ -65,13 +65,13 @@ class UpdateEmailUseCase internal constructor( sealed interface Result { sealed interface Success : Result { - object VerificationEmailSent : Success - object NoChange : Success + data object VerificationEmailSent : Success + data object NoChange : Success } sealed interface Failure : Result { - object InvalidEmail : Failure - object EmailAlreadyInUse : Failure + data object InvalidEmail : Failure + data object EmailAlreadyInUse : Failure data class GenericFailure(val error: NetworkFailure) : Failure } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/readReceipts/PersistReadReceiptsStatusConfigUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/readReceipts/PersistReadReceiptsStatusConfigUseCase.kt index c24060597e6..3692c0680b5 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/readReceipts/PersistReadReceiptsStatusConfigUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/readReceipts/PersistReadReceiptsStatusConfigUseCase.kt @@ -53,6 +53,6 @@ internal class PersistReadReceiptsStatusConfigUseCaseImpl( } sealed class ReadReceiptStatusConfigResult { - object Success : ReadReceiptStatusConfigResult() + data object Success : ReadReceiptStatusConfigResult() data class Failure(val cause: CoreFailure) : ReadReceiptStatusConfigResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/screenshotCensoring/ObserveScreenshotCensoringConfigUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/screenshotCensoring/ObserveScreenshotCensoringConfigUseCase.kt index 07c1ec3b6c1..79b02782a92 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/screenshotCensoring/ObserveScreenshotCensoringConfigUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/screenshotCensoring/ObserveScreenshotCensoringConfigUseCase.kt @@ -54,9 +54,9 @@ internal class ObserveScreenshotCensoringConfigUseCaseImpl( } sealed class ObserveScreenshotCensoringConfigResult { - object Disabled : ObserveScreenshotCensoringConfigResult() + data object Disabled : ObserveScreenshotCensoringConfigResult() sealed class Enabled : ObserveScreenshotCensoringConfigResult() { - object ChosenByUser : Enabled() - object EnforcedByTeamSelfDeletingSettings : Enabled() + data object ChosenByUser : Enabled() + data object EnforcedByTeamSelfDeletingSettings : Enabled() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/screenshotCensoring/PersistScreenshotCensoringConfigUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/screenshotCensoring/PersistScreenshotCensoringConfigUseCase.kt index 812e9d93876..06288cc4268 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/screenshotCensoring/PersistScreenshotCensoringConfigUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/screenshotCensoring/PersistScreenshotCensoringConfigUseCase.kt @@ -48,6 +48,6 @@ internal class PersistScreenshotCensoringConfigUseCaseImpl( } sealed class PersistScreenshotCensoringConfigResult { - object Success : PersistScreenshotCensoringConfigResult() + data object Success : PersistScreenshotCensoringConfigResult() data class Failure(val cause: CoreFailure) : PersistScreenshotCensoringConfigResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/typingIndicator/PersistTypingIndicatorStatusConfigUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/typingIndicator/PersistTypingIndicatorStatusConfigUseCase.kt index c4bfd3d0551..68d826121a7 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/typingIndicator/PersistTypingIndicatorStatusConfigUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/typingIndicator/PersistTypingIndicatorStatusConfigUseCase.kt @@ -53,6 +53,6 @@ internal class PersistTypingIndicatorStatusConfigUseCaseImpl( } sealed class TypingIndicatorConfigResult { - object Success : TypingIndicatorConfigResult() + data object Success : TypingIndicatorConfigResult() data class Failure(val cause: CoreFailure) : TypingIndicatorConfigResult() } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/webSocketStatus/ObservePersistentWebSocketConnectionStatusUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/webSocketStatus/ObservePersistentWebSocketConnectionStatusUseCase.kt index 0159456667e..7cb301c1713 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/webSocketStatus/ObservePersistentWebSocketConnectionStatusUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/webSocketStatus/ObservePersistentWebSocketConnectionStatusUseCase.kt @@ -38,7 +38,7 @@ interface ObservePersistentWebSocketConnectionStatusUseCase { sealed class Result { class Success(val persistentWebSocketStatusListFlow: Flow>) : Result() sealed class Failure : Result() { - object StorageFailure : Failure() + data object StorageFailure : Failure() data class Generic(val genericFailure: CoreFailure) : Failure() } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/featureFlags/KaliumConfigs.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/featureFlags/KaliumConfigs.kt index 269a5e25572..4aea8d10954 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/featureFlags/KaliumConfigs.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/featureFlags/KaliumConfigs.kt @@ -48,6 +48,6 @@ data class KaliumConfigs( ) sealed interface BuildFileRestrictionState { - object NoRestriction : BuildFileRestrictionState + data object NoRestriction : BuildFileRestrictionState data class AllowSome(val allowedType: List) : BuildFileRestrictionState } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/DefaultWorker.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/DefaultWorker.kt index 6448cc57f99..eb73f6c80cb 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/DefaultWorker.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/DefaultWorker.kt @@ -19,9 +19,9 @@ package com.wire.kalium.logic.sync sealed class Result { - object Success : Result() - object Failure : Result() - object Retry : Result() + data object Success : Result() + data object Failure : Result() + data object Retry : Result() } interface DefaultWorker { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/MLSMessageFailureHandler.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/MLSMessageFailureHandler.kt index 85bcddeaa35..749c9d4c488 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/MLSMessageFailureHandler.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/MLSMessageFailureHandler.kt @@ -21,9 +21,9 @@ import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.MLSFailure sealed class MLSMessageFailureResolution { - object Ignore : MLSMessageFailureResolution() - object InformUser : MLSMessageFailureResolution() - object OutOfSync : MLSMessageFailureResolution() + data object Ignore : MLSMessageFailureResolution() + data object InformUser : MLSMessageFailureResolution() + data object OutOfSync : MLSMessageFailureResolution() } internal object MLSMessageFailureHandler { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/MessageUnpackResult.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/MessageUnpackResult.kt index a7f01357b09..22280866463 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/MessageUnpackResult.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/MessageUnpackResult.kt @@ -33,7 +33,7 @@ internal sealed interface MessageUnpackResult { * The [Event] was successfully processed by the unpacker, and didn't result in * any [ApplicationMessage], only protocol-specific signaling/handshake. */ - object HandshakeMessage : MessageUnpackResult + data object HandshakeMessage : MessageUnpackResult /** * The processed [Event] was successfully processed and resulted in a [ApplicationMessage]. diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/slow/SlowSyncCriteriaProvider.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/slow/SlowSyncCriteriaProvider.kt index 6f9accf008f..9671f11219c 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/slow/SlowSyncCriteriaProvider.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/slow/SlowSyncCriteriaProvider.kt @@ -39,7 +39,7 @@ internal interface SyncCriteriaResolution { /** * All criteria are satisfied and Sync is free to start or keep going. */ - object Ready : SyncCriteriaResolution + data object Ready : SyncCriteriaResolution /** * At least a criterion is not satisfied diff --git a/network-util/src/commonMain/kotlin/com/wire/kalium/network/NetworkStateObserver.kt b/network-util/src/commonMain/kotlin/com/wire/kalium/network/NetworkStateObserver.kt index 93a7369f00e..b0d57865167 100644 --- a/network-util/src/commonMain/kotlin/com/wire/kalium/network/NetworkStateObserver.kt +++ b/network-util/src/commonMain/kotlin/com/wire/kalium/network/NetworkStateObserver.kt @@ -47,7 +47,7 @@ interface NetworkStateObserver { } sealed class NetworkState { - object ConnectedWithInternet : NetworkState() - object ConnectedWithoutInternet : NetworkState() - object NotConnected : NetworkState() + data object ConnectedWithInternet : NetworkState() + data object ConnectedWithoutInternet : NetworkState() + data object NotConnected : NetworkState() } diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ConversationMemberAddedResponse.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ConversationMemberAddedResponse.kt index 800c18932cc..10189a6ca74 100644 --- a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ConversationMemberAddedResponse.kt +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ConversationMemberAddedResponse.kt @@ -24,7 +24,7 @@ sealed class ConversationMemberAddedResponse { /** * The users requested to be added were already members */ - object Unchanged : ConversationMemberAddedResponse() + data object Unchanged : ConversationMemberAddedResponse() data class Changed(val event: EventContentDTO.Conversation.MemberJoinDTO) : ConversationMemberAddedResponse() } diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ConversationMemberRemovedResponse.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ConversationMemberRemovedResponse.kt index 8959748ee43..9cee3d8ce34 100644 --- a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ConversationMemberRemovedResponse.kt +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ConversationMemberRemovedResponse.kt @@ -25,7 +25,7 @@ sealed class ConversationMemberRemovedResponse { /** * The users requested to be removed were not members */ - object Unchanged : ConversationMemberRemovedResponse() + data object Unchanged : ConversationMemberRemovedResponse() data class Changed(val event: EventContentDTO.Conversation.MemberLeaveDTO) : ConversationMemberRemovedResponse() diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ConversationRenameResponse.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ConversationRenameResponse.kt index 7a0a800ece8..07ea4f72bfe 100644 --- a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ConversationRenameResponse.kt +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ConversationRenameResponse.kt @@ -24,7 +24,7 @@ import kotlinx.serialization.Serializable @Serializable sealed class ConversationRenameResponse { - object Unchanged : ConversationRenameResponse() + data object Unchanged : ConversationRenameResponse() data class Changed(val event: EventContentDTO.Conversation.ConversationRenameDTO) : ConversationRenameResponse() } diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ReceiptMode.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ReceiptMode.kt index 946cc5fc7da..ce6c208e9b7 100644 --- a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ReceiptMode.kt +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/ReceiptMode.kt @@ -33,7 +33,7 @@ enum class ReceiptMode(val value: Int) { DISABLED(0), ENABLED(1); - object ReceiptModeAsIntSerializer : KSerializer { + data object ReceiptModeAsIntSerializer : KSerializer { override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("ReceiptMode", PrimitiveKind.INT).nullable override fun serialize(encoder: Encoder, value: ReceiptMode) { diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/UpdateConversationAccessResponse.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/UpdateConversationAccessResponse.kt index d0ca7d191a6..10cce252b57 100644 --- a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/UpdateConversationAccessResponse.kt +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/UpdateConversationAccessResponse.kt @@ -21,6 +21,6 @@ package com.wire.kalium.network.api.base.authenticated.conversation import com.wire.kalium.network.api.base.authenticated.notification.EventContentDTO sealed class UpdateConversationAccessResponse { - object AccessUnchanged : UpdateConversationAccessResponse() + data object AccessUnchanged : UpdateConversationAccessResponse() data class AccessUpdated(val event: EventContentDTO.Conversation.AccessUpdate) : UpdateConversationAccessResponse() } diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/UpdateConversationProtocolResponse.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/UpdateConversationProtocolResponse.kt index 2770ea32204..8eefcc172ef 100644 --- a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/UpdateConversationProtocolResponse.kt +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/UpdateConversationProtocolResponse.kt @@ -20,6 +20,6 @@ package com.wire.kalium.network.api.base.authenticated.conversation import com.wire.kalium.network.api.base.authenticated.notification.EventContentDTO sealed class UpdateConversationProtocolResponse { - object ProtocolUnchanged : UpdateConversationProtocolResponse() + data object ProtocolUnchanged : UpdateConversationProtocolResponse() data class ProtocolUpdated(val event: EventContentDTO.Conversation.ProtocolUpdate) : UpdateConversationProtocolResponse() } diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/UpdateConversationReceiptModeResponse.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/UpdateConversationReceiptModeResponse.kt index 0aac6f09ee0..dbbcdf09930 100644 --- a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/UpdateConversationReceiptModeResponse.kt +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/conversation/UpdateConversationReceiptModeResponse.kt @@ -3,6 +3,6 @@ package com.wire.kalium.network.api.base.authenticated.conversation import com.wire.kalium.network.api.base.authenticated.notification.EventContentDTO sealed class UpdateConversationReceiptModeResponse { - object ReceiptModeUnchanged : UpdateConversationReceiptModeResponse() + data object ReceiptModeUnchanged : UpdateConversationReceiptModeResponse() data class ReceiptModeUpdated(val event: EventContentDTO.Conversation.ReceiptModeUpdate) : UpdateConversationReceiptModeResponse() } diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/message/MessageApi.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/message/MessageApi.kt index 6d856d3b1ba..cc1d94d124e 100644 --- a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/message/MessageApi.kt +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/message/MessageApi.kt @@ -29,13 +29,13 @@ interface MessageApi { * All missing recipients clients will be ignored * The message will be sent regardless if the recipients list is correct or not */ - object IgnoreAll : QualifiedMessageOption() + data object IgnoreAll : QualifiedMessageOption() /** * All missing recipients clients will be reported http error code 412 * The message will not be sent unless the list is correct */ - object ReportAll : QualifiedMessageOption() + data object ReportAll : QualifiedMessageOption() data class IgnoreSome(val userIDs: List) : QualifiedMessageOption() data class ReportSome(val userIDs: List) : QualifiedMessageOption() } diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/model/AddServiceResponse.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/model/AddServiceResponse.kt index da74142b370..05c0de3b3a4 100644 --- a/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/model/AddServiceResponse.kt +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/base/model/AddServiceResponse.kt @@ -31,7 +31,7 @@ sealed class ServiceAddedResponse { /** * The service requested to be added were already members */ - object Unchanged : ServiceAddedResponse() + data object Unchanged : ServiceAddedResponse() data class Changed(val event: EventContentDTO.Conversation.MemberJoinDTO) : ServiceAddedResponse() } diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/tools/ServerConfigDTO.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/tools/ServerConfigDTO.kt index ecedf6156be..705690a9695 100644 --- a/network/src/commonMain/kotlin/com/wire/kalium/network/tools/ServerConfigDTO.kt +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/tools/ServerConfigDTO.kt @@ -55,8 +55,8 @@ fun isProxyRequired(serverConfigDTOApiProxy: ServerConfigDTO.ApiProxy?): Boolean sealed class ApiVersionDTO(open val version: Int) { sealed class Invalid(override val version: Int) : ApiVersionDTO(version) { - object New : Invalid(NEW_API_VERSION_NUMBER) - object Unknown : Invalid(UNKNOWN_API_VERSION_NUMBER) + data object New : Invalid(NEW_API_VERSION_NUMBER) + data object Unknown : Invalid(UNKNOWN_API_VERSION_NUMBER) } data class Valid(override val version: Int) : ApiVersionDTO(version) diff --git a/persistence/src/appleMain/kotlin/com/wire/kalium/persistence/db/UserDatabase.kt b/persistence/src/appleMain/kotlin/com/wire/kalium/persistence/db/UserDatabase.kt index aa2a2ac0b20..c6b159433b0 100644 --- a/persistence/src/appleMain/kotlin/com/wire/kalium/persistence/db/UserDatabase.kt +++ b/persistence/src/appleMain/kotlin/com/wire/kalium/persistence/db/UserDatabase.kt @@ -34,7 +34,7 @@ import platform.Foundation.NSURL sealed interface DatabaseCredentials { data class Passphrase(val value: String) : DatabaseCredentials - object NotSet : DatabaseCredentials + data object NotSet : DatabaseCredentials } // TODO encrypt database using sqlcipher diff --git a/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/config/UserConfigStorage.kt b/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/config/UserConfigStorage.kt index 9d80f1d1b1e..42c8854fe63 100644 --- a/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/config/UserConfigStorage.kt +++ b/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/config/UserConfigStorage.kt @@ -214,11 +214,11 @@ sealed class SelfDeletionTimerEntity { @Serializable @SerialName("disabled") - object Disabled : SelfDeletionTimerEntity() + data object Disabled : SelfDeletionTimerEntity() @Serializable @SerialName("enabled") - object Enabled : SelfDeletionTimerEntity() + data object Enabled : SelfDeletionTimerEntity() @Serializable @SerialName("enforced") diff --git a/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/conversation/ConversationEntity.kt b/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/conversation/ConversationEntity.kt index cf445bc12ea..e670830f6cb 100644 --- a/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/conversation/ConversationEntity.kt +++ b/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/conversation/ConversationEntity.kt @@ -79,7 +79,7 @@ data class ConversationEntity( enum class MutedStatus { ALL_ALLOWED, ONLY_MENTIONS_AND_REPLIES_ALLOWED, MENTIONS_MUTED, ALL_MUTED } sealed interface ProtocolInfo { - object Proteus : ProtocolInfo + data object Proteus : ProtocolInfo data class MLS( override val groupId: String, override val groupState: ConversationEntity.GroupState, diff --git a/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/member/MemberEntity.kt b/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/member/MemberEntity.kt index 7a57a36a6a1..4d6d7159147 100644 --- a/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/member/MemberEntity.kt +++ b/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/member/MemberEntity.kt @@ -24,8 +24,8 @@ data class MemberEntity( val role: Role ) { sealed class Role { - object Member : Role() - object Admin : Role() + data object Member : Role() + data object Admin : Role() data class Unknown(val name: String) : Role() } } diff --git a/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/message/MessageEntity.kt b/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/message/MessageEntity.kt index df12d11c9f7..5adf7796f75 100644 --- a/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/message/MessageEntity.kt +++ b/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/message/MessageEntity.kt @@ -117,7 +117,7 @@ sealed interface MessageEntity { } sealed class EditStatus { - object NotEdited : EditStatus() + data object NotEdited : EditStatus() data class Edited(val lastDate: Instant) : EditStatus() override fun toString(): String { @@ -301,7 +301,7 @@ sealed class MessageEntityContent { val senderClientId: String?, ) : Regular() - object MLSWrongEpochWarning : System() + data object MLSWrongEpochWarning : System() data class MemberChange( val memberUserIdList: List, @@ -319,17 +319,17 @@ sealed class MessageEntityContent { val buttonList: List ) : Regular() - object MissedCall : System() - object CryptoSessionReset : System() + data object MissedCall : System() + data object CryptoSessionReset : System() data class ConversationRenamed(val conversationName: String) : System() data class TeamMemberRemoved(val userName: String) : System() data class NewConversationReceiptMode(val receiptMode: Boolean) : System() data class ConversationReceiptModeChanged(val receiptMode: Boolean) : System() data class ConversationMessageTimerChanged(val messageTimer: Long?) : System() data class ConversationProtocolChanged(val protocol: ConversationEntity.Protocol) : System() - object HistoryLostProtocolChanged : System() - object HistoryLost : System() - object ConversationCreated : System() + data object HistoryLostProtocolChanged : System() + data object HistoryLost : System() + data object ConversationCreated : System() data object ConversationDegradedMLS : System() data object ConversationVerifiedMLS : System() data object ConversationDegradedProteus : System() @@ -422,8 +422,8 @@ sealed class MessagePreviewEntityContent { data class ConversationNameChange(val adminName: String?) : MessagePreviewEntityContent() data class TeamMemberRemoved(val userName: String?) : MessagePreviewEntityContent() data class Ephemeral(val isGroupConversation: Boolean) : MessagePreviewEntityContent() - object CryptoSessionReset : MessagePreviewEntityContent() - object Unknown : MessagePreviewEntityContent() + data object CryptoSessionReset : MessagePreviewEntityContent() + data object Unknown : MessagePreviewEntityContent() } @@ -459,7 +459,7 @@ sealed class DeliveryStatusEntity { val recipientsFailedDelivery: List ) : DeliveryStatusEntity() - object CompleteDelivery : DeliveryStatusEntity() + data object CompleteDelivery : DeliveryStatusEntity() } @Serializable