diff --git a/composeApp/src/androidMain/kotlin/at/torch/android/MainActivity.kt b/composeApp/src/androidMain/kotlin/at/torch/android/MainActivity.kt index 11d2be8e..d9811fb2 100644 --- a/composeApp/src/androidMain/kotlin/at/torch/android/MainActivity.kt +++ b/composeApp/src/androidMain/kotlin/at/torch/android/MainActivity.kt @@ -46,9 +46,9 @@ class MainActivity : ComponentActivity() { } fun stopNfcReader() { - if (_root_ide_package_.com.machankura.compose.ui.composable.widgets.nfc.NfcStateRepository.isReading()) { - _root_ide_package_.com.machankura.compose.ui.composable.widgets.nfc.NfcStateRepository.updateState( - _root_ide_package_.com.machankura.compose.ui.composable.widgets.nfc.NfcState.Inactive) + if (com.machankura.compose.ui.composable.widgets.nfc.NfcStateRepository.isReading()) { + com.machankura.compose.ui.composable.widgets.nfc.NfcStateRepository.updateState( + com.machankura.compose.ui.composable.widgets.nfc.NfcState.Inactive) } nfcAdapter?.disableReaderMode(this@MainActivity) } diff --git a/composeApp/src/androidMain/kotlin/at/torch/compose/Platform.android.kt b/composeApp/src/androidMain/kotlin/at/torch/compose/Platform.android.kt index 98d663e7..4fed6e9a 100644 --- a/composeApp/src/androidMain/kotlin/at/torch/compose/Platform.android.kt +++ b/composeApp/src/androidMain/kotlin/at/torch/compose/Platform.android.kt @@ -6,4 +6,4 @@ class AndroidPlatform : Platform { override val name: String = "Android ${Build.VERSION.SDK_INT}" } -actual fun getPlatform(): Platform = _root_ide_package_.at.torch.compose.AndroidPlatform() \ No newline at end of file +actual fun getPlatform(): Platform = AndroidPlatform() \ No newline at end of file diff --git a/composeApp/src/androidMain/kotlin/fr/acinq/phoenix/android/services/HceService.kt b/composeApp/src/androidMain/kotlin/fr/acinq/phoenix/android/services/HceService.kt index 28ebe889..eaf58007 100644 --- a/composeApp/src/androidMain/kotlin/fr/acinq/phoenix/android/services/HceService.kt +++ b/composeApp/src/androidMain/kotlin/fr/acinq/phoenix/android/services/HceService.kt @@ -75,7 +75,7 @@ class HceService : HostApduService() { } } } - return Service.START_NOT_STICKY + return START_NOT_STICKY } @OptIn(ExperimentalStdlibApi::class) diff --git a/composeApp/src/androidMain/kotlin/fr/acinq/phoenix/android/services/PaymentsForegroundService.kt b/composeApp/src/androidMain/kotlin/fr/acinq/phoenix/android/services/PaymentsForegroundService.kt index 3e5abe2e..311d2e0f 100644 --- a/composeApp/src/androidMain/kotlin/fr/acinq/phoenix/android/services/PaymentsForegroundService.kt +++ b/composeApp/src/androidMain/kotlin/fr/acinq/phoenix/android/services/PaymentsForegroundService.kt @@ -135,7 +135,7 @@ class PaymentsForegroundService : Service() { } // show a notification -- this is mandatory! - val notif = SystemNotificationHelper.notifyRunningHeadless(applicationContext) + SystemNotificationHelper.notifyRunningHeadless(applicationContext) // startForeground(notif) // service will automatically shutdown -- delay is short if the message is ignored diff --git a/composeApp/src/androidMain/kotlin/fr/acinq/phoenix/utils/SystemNotificationHelper.kt b/composeApp/src/androidMain/kotlin/fr/acinq/phoenix/utils/SystemNotificationHelper.kt index c70641b5..9a2881d6 100644 --- a/composeApp/src/androidMain/kotlin/fr/acinq/phoenix/utils/SystemNotificationHelper.kt +++ b/composeApp/src/androidMain/kotlin/fr/acinq/phoenix/utils/SystemNotificationHelper.kt @@ -149,7 +149,7 @@ object SystemNotificationHelper { // amountIncoming.toPrettyString(BitcoinUnit.Sat, withUnit = true)), message = when { source == LiquidityEvents.Source.OnChainWallet && nextTimeoutRemainingBlocks != null && nextTimeoutRemainingBlocks < SWAP_TIMEOUT_THRESHOLD_IN_BLOCKS -> { - val remainingTimeMillis = nextTimeoutRemainingBlocks * 10 * DateUtils.MINUTE_IN_MILLIS + nextTimeoutRemainingBlocks * 10 * DateUtils.MINUTE_IN_MILLIS // TODO: context.getString(R.string.notif_rejected_policy_disabled_timeout, (currentTimestampMillis() + remainingTimeMillis).toAbsoluteDateString()) "Rejected policy disabled timeout" } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/TorchGlobal.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/TorchGlobal.kt index c0872b1e..15ef4008 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/TorchGlobal.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/TorchGlobal.kt @@ -2,6 +2,4 @@ package at.torch.compose class TorchGlobal( val platformContext: PlatformContext -) { - -} \ No newline at end of file +) \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/cryptography/Extensions.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/cryptography/Extensions.kt index d8c91085..fda4dbfd 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/cryptography/Extensions.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/cryptography/Extensions.kt @@ -8,12 +8,12 @@ import com.vitorpamplona.quartz.nip19Bech32.bech32.Bech32 import com.vitorpamplona.quartz.nip51Lists.encryption.PrivateTagsInContent import kotlin.time.Instant -fun at.torch.compose.database.model.UnsignedNostrEvent.signOrThrow(nsec: String): at.torch.compose.database.model.NostrEvent { +fun at.torch.compose.database.model.UnsignedNostrEvent.signOrThrow(nsec: String): NostrEvent { val hexPrivateKey = Bech32.decodeBytes(nsec).second return this.signOrThrow(hexPrivateKey) } -fun at.torch.compose.database.model.UnsignedNostrEvent.signOrThrow(hexPrivateKey: ByteArray): at.torch.compose.database.model.NostrEvent { +fun at.torch.compose.database.model.UnsignedNostrEvent.signOrThrow(hexPrivateKey: ByteArray): NostrEvent { val tempSigner = NostrSignerSync( KeyPair( privKey = hexPrivateKey diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/dao/NostrDao.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/dao/NostrDao.kt index 3ab7ab8a..e9caa98b 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/dao/NostrDao.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/dao/NostrDao.kt @@ -53,7 +53,7 @@ abstract class NostrDao( @Transaction open suspend fun publishNostrEvent( unsignedNostrEvent: at.torch.compose.database.model.UnsignedNostrEvent, - nostrEvent: at.torch.compose.database.model.NostrEvent, + nostrEvent: NostrEvent, relayURLs: List, activeKeyPair: KeyPair ) { @@ -88,7 +88,7 @@ abstract class NostrDao( @Transaction open suspend fun storeNostrEvent( - nostrEvent: at.torch.compose.database.model.NostrEvent, + nostrEvent: NostrEvent, relayURL: String, synchronizationRelayURLs: List, level: Int, @@ -136,7 +136,7 @@ abstract class NostrDao( } private suspend fun indexNostrEvent( - nostrEvent: at.torch.compose.database.model.NostrEvent, + nostrEvent: NostrEvent, relayURL: String, synchronizationRelayURLs: List, level: Int, @@ -711,7 +711,7 @@ abstract class NostrDao( chatMessageRelayListEvent.relays() .map { normalizedRelayUrl -> NegentropySynchronizeRequest( - id = NegentropySynchronizeRequest.Companion.computeId( + id = NegentropySynchronizeRequest.computeId( relayURL = normalizedRelayUrl.url, synchronizationFilter = synchronizationFilter ), @@ -1023,7 +1023,7 @@ abstract class NostrDao( ) negentropySynchronizeRequests.add( NegentropySynchronizeRequest( - id = _root_ide_package_.at.torch.compose.database.model.NegentropySynchronizeRequest.Companion.computeId( + id = NegentropySynchronizeRequest.computeId( relayUrlProfilePublicKey.key, synchronizationFilter ), @@ -1044,7 +1044,7 @@ abstract class NostrDao( Clock.System.now().toEpochMilliseconds() negentropySynchronizeRequests.add( NegentropySynchronizeRequest( - id = _root_ide_package_.at.torch.compose.database.model.NegentropySynchronizeRequest.Companion.computeId( + id = NegentropySynchronizeRequest.computeId( relayUrlEventIds.key, synchronizationFilter ), diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/ChatMessage.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/ChatMessage.kt index ee22096b..a1b6d1de 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/ChatMessage.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/ChatMessage.kt @@ -46,5 +46,4 @@ data class ChatMessage( override val savedAt: Instant = Clock.System.now(), override val viewedAt: Instant? = null, override val deletedAt: Instant? = null, // Who this message should be seen by (used to derive conversationId) -): TimestampedEntity, LocalStoreEntity, UserViewableEntity, SoftDeletableEntity { -} \ No newline at end of file +): TimestampedEntity, LocalStoreEntity, UserViewableEntity, SoftDeletableEntity \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/InReplyToRelation.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/InReplyToRelation.kt index 85eb381d..747a3d25 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/InReplyToRelation.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/InReplyToRelation.kt @@ -59,6 +59,4 @@ data class InReplyToRelation( ): at.torch.compose.database.model.traits.TimestampedEntity, at.torch.compose.database.model.traits.LocalStoreEntity, at.torch.compose.database.model.traits.UserViewableEntity, - at.torch.compose.database.model.traits.SoftDeletableEntity { - -} \ No newline at end of file + at.torch.compose.database.model.traits.SoftDeletableEntity \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/MarmotKeyPackageBundle.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/MarmotKeyPackageBundle.kt index 5af88fb2..a06f5876 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/MarmotKeyPackageBundle.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/MarmotKeyPackageBundle.kt @@ -37,6 +37,4 @@ data class MarmotKeyPackageBundle( override val savedAt: Instant = Clock.System.now(), override val deletedAt: Instant? = null, override val broadcastedAt: Instant? = null, -): TimestampedEntity, LocalStoreEntity, BroadcastableEntity, SoftDeletableEntity { - -} \ No newline at end of file +): TimestampedEntity, LocalStoreEntity, BroadcastableEntity, SoftDeletableEntity \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/NegentropySynchronizeRequest.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/NegentropySynchronizeRequest.kt index 8a7f65e0..287dfcab 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/NegentropySynchronizeRequest.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/NegentropySynchronizeRequest.kt @@ -21,7 +21,7 @@ import kotlin.uuid.Uuid entity = NostrEvent::class, parentColumns = ["id"], childColumns = ["nostrEventId"], - onDelete = ForeignKey.Companion.CASCADE, + onDelete = ForeignKey.CASCADE, ), ], indices = [ diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/NostrEvent.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/NostrEvent.kt index 24c0009c..85c12124 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/NostrEvent.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/NostrEvent.kt @@ -333,7 +333,7 @@ data class NostrEvent( } } - val quotedNotes = _root_ide_package_.at.torch.compose.ui.composable.widgets.content.ContentParser.parse(content.trimEnd('\n', '\r'), emptyMap(), emptyMap(), trimBlankLines = true) + val quotedNotes = at.torch.compose.ui.composable.widgets.content.ContentParser.parse(content.trimEnd('\n', '\r'), emptyMap(), emptyMap(), trimBlankLines = true) .filterIsInstance() .firstOrNull() @@ -386,7 +386,7 @@ data class NostrEvent( } fun toZap(): Zap? = try { if (kind == LnZapEvent.KIND) { - val zapEvent = EventFactory.create( + EventFactory.create( id = id, pubKey = pubKey, createdAt = createdAt.epochSeconds, @@ -441,7 +441,7 @@ data class NostrEvent( fun fromEvent(event: Event, synchronizeNostrEventRequest: SynchronizeNostrEventRequest? = null): NostrEvent? = try { // TODO: Check for unsupported kind - val taggedEvent = event.firstTaggedEvent() + event.firstTaggedEvent() val quotedEvent = when (val taggedQuote = event.firstTaggedQuote()) { is QEventTag -> { diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/NostrEventRelay.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/NostrEventRelay.kt index e7c146c3..58b09959 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/NostrEventRelay.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/NostrEventRelay.kt @@ -32,7 +32,4 @@ data class NostrEventRelay( override val createdAt: Instant = Clock.System.now(), override val updatedAt: Instant = createdAt, -): NostrEventEntity, TimestampedEntity { - - -} \ No newline at end of file +): NostrEventEntity, TimestampedEntity \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/Profile.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/Profile.kt index 4c9cc65e..13fc9f2f 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/Profile.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/Profile.kt @@ -172,7 +172,7 @@ data class Profile( Text( text = staticIdentifier, style = MaterialTheme.typography.labelMedium, - color = _root_ide_package_.at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(publicKey) + color = at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(publicKey) ) } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/QuotedRelation.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/QuotedRelation.kt index ac9234c2..b738826c 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/QuotedRelation.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/QuotedRelation.kt @@ -49,6 +49,4 @@ data class QuotedRelation( at.torch.compose.database.model.traits.LocalStoreEntity, at.torch.compose.database.model.traits.UserViewableEntity, at.torch.compose.database.model.traits.BroadcastableEntity, - at.torch.compose.database.model.traits.SoftDeletableEntity { - -} \ No newline at end of file + at.torch.compose.database.model.traits.SoftDeletableEntity \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/RepostedRelation.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/RepostedRelation.kt index b8adfe0f..f54b1209 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/RepostedRelation.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/RepostedRelation.kt @@ -48,6 +48,4 @@ data class RepostedRelation( at.torch.compose.database.model.traits.LocalStoreEntity, at.torch.compose.database.model.traits.UserViewableEntity, at.torch.compose.database.model.traits.BroadcastableEntity, - at.torch.compose.database.model.traits.SoftDeletableEntity { - -} \ No newline at end of file + at.torch.compose.database.model.traits.SoftDeletableEntity \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalChatRoom.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalChatRoom.kt index a0d10e26..2ed4caab 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalChatRoom.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalChatRoom.kt @@ -12,7 +12,7 @@ data class LocalChatRoom( @Embedded val chatRoom: at.torch.compose.database.model.ChatRoom, @Relation( - entity = _root_ide_package_.at.torch.compose.database.model.Participant::class, + entity = at.torch.compose.database.model.Participant::class, parentColumns = ["id"], entityColumns = ["chatRoomId"], ) @@ -23,7 +23,7 @@ data class LocalChatRoom( if (chatRoom.subject != null) { Text( text = chatRoom.subject, - color = _root_ide_package_.at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(chatRoom.id) + color = at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(chatRoom.id) ) } else { if (localParticipants.size == 1) { @@ -33,7 +33,7 @@ data class LocalChatRoom( } else { // Remove the active user publicKey from participants... val participantNames = localParticipants.filter { it.participant.participantPublicKey != chatRoom.userPublicKey }.map { buildAnnotatedString { - withStyle(style = SpanStyle(color = _root_ide_package_.at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(it.participant.participantPublicKey))) { + withStyle(style = SpanStyle(color = at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(it.participant.participantPublicKey))) { append(it.profile?.humanReadableNameOrPubkey() ?: "unknown participant") } } } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalInReplyToNostrEvent.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalInReplyToNostrEvent.kt index 616281e2..d7a9b364 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalInReplyToNostrEvent.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalInReplyToNostrEvent.kt @@ -33,7 +33,7 @@ data class LocalInReplyToNostrEvent( val profile: at.torch.compose.database.model.Profile?, @Relation( - entity = _root_ide_package_.at.torch.compose.database.model.Mention::class, + entity = at.torch.compose.database.model.Mention::class, parentColumns = ["inReplyToNostrEventId"], entityColumns = ["mentioningNostrEventId"], ) diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalNostrEvent.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalNostrEvent.kt index 538015cf..4ca02a43 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalNostrEvent.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalNostrEvent.kt @@ -26,28 +26,28 @@ data class LocalNostrEvent( val profile: at.torch.compose.database.model.Profile?, @Relation( - entity = _root_ide_package_.at.torch.compose.database.model.RepostedRelation::class, + entity = at.torch.compose.database.model.RepostedRelation::class, parentColumns = ["id"], entityColumns = ["repostingNostrEventId"] ) val localRepostedNostrEvent: LocalRepostedNostrEvent? = null, @Relation( - entity = _root_ide_package_.at.torch.compose.database.model.QuotedRelation::class, + entity = at.torch.compose.database.model.QuotedRelation::class, parentColumns = ["id"], entityColumns = ["quotingNostrEventId"] ) val localQuotedNostrEvent: LocalQuotedNostrEvent? = null, @Relation( - entity = _root_ide_package_.at.torch.compose.database.model.InReplyToRelation::class, + entity = at.torch.compose.database.model.InReplyToRelation::class, parentColumns = ["id"], entityColumns = ["replyingNostrEventId"] ) val localInReplyToNostrEvent: LocalInReplyToNostrEvent? = null, @Relation( - entity = _root_ide_package_.at.torch.compose.database.model.Mention::class, + entity = at.torch.compose.database.model.Mention::class, parentColumns = ["id"], entityColumns = ["mentioningNostrEventId"], ) diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalProfileWithFollowers.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalProfileWithFollowers.kt index f906b04b..399245c2 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalProfileWithFollowers.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalProfileWithFollowers.kt @@ -17,7 +17,7 @@ data class LocalProfileWithFollowers( parentColumns = ["pubKey"], entityColumns = ["publicKey"], associateBy = Junction( - value = _root_ide_package_.at.torch.compose.database.model.Connection::class, + value = at.torch.compose.database.model.Connection::class, parentColumns = ["destinationPublicKey"], entityColumns = ["sourcePublicKey"] ) diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalProfileWithFollowing.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalProfileWithFollowing.kt index 355b048c..61625589 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalProfileWithFollowing.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalProfileWithFollowing.kt @@ -17,7 +17,7 @@ data class LocalProfileWithFollowing( parentColumns = ["pubKey"], entityColumns = ["publicKey"], associateBy = Junction( - value = _root_ide_package_.at.torch.compose.database.model.Connection::class, + value = at.torch.compose.database.model.Connection::class, parentColumns = ["sourcePublicKey"], entityColumns = ["destinationPublicKey"] ) diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalQuotedNostrEvent.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalQuotedNostrEvent.kt index 0a0018aa..d64b91ad 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalQuotedNostrEvent.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalQuotedNostrEvent.kt @@ -34,7 +34,7 @@ data class LocalQuotedNostrEvent( val profile: at.torch.compose.database.model.Profile?, @Relation( - entity = _root_ide_package_.at.torch.compose.database.model.Mention::class, + entity = at.torch.compose.database.model.Mention::class, parentColumns = ["quotedNostrEventId"], entityColumns = ["mentioningNostrEventId"], ) @@ -73,7 +73,7 @@ data class LocalQuotedNostrEvent( Text( text = staticIdentifier, style = MaterialTheme.typography.bodySmall, - color = _root_ide_package_.at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromProfile(profile) + color = at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromProfile(profile) ) } } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalRepostedNostrEvent.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalRepostedNostrEvent.kt index 68658f9d..65781a06 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalRepostedNostrEvent.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/model/intermdiate/LocalRepostedNostrEvent.kt @@ -33,7 +33,7 @@ data class LocalRepostedNostrEvent( val profile: at.torch.compose.database.model.Profile?, @Relation( - entity = _root_ide_package_.at.torch.compose.database.model.Mention::class, + entity = at.torch.compose.database.model.Mention::class, parentColumns = ["repostedNostrEventId"], entityColumns = ["mentioningNostrEventId"], ) diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/repository/DatabaseNostrRepository.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/repository/DatabaseNostrRepository.kt index f867f166..a070599e 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/repository/DatabaseNostrRepository.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/repository/DatabaseNostrRepository.kt @@ -89,7 +89,7 @@ class DatabaseNostrRepository( database.connectionDao().delete(connection) } - override suspend fun observeUnsignedNostrEvents(publicKey: HexKey): Flow { + override suspend fun observeUnsignedNostrEvents(publicKey: HexKey): Flow { return database.unsignedNostrEventDao().observeUnsignedNostrEvents(publicKey) } @@ -131,7 +131,7 @@ class DatabaseNostrRepository( followUsers.map { it.toTagArray() } unsignedNostrEvents.add( - _root_ide_package_.at.torch.compose.database.model.UnsignedNostrEvent( + UnsignedNostrEvent( pubKey = publicKey, kind = ContactListEvent.KIND, tags = contactListTagList.toTypedArray(), @@ -142,11 +142,11 @@ class DatabaseNostrRepository( ) unsignedNostrEvents.add( - _root_ide_package_.at.torch.compose.database.model.UnsignedNostrEvent( + UnsignedNostrEvent( pubKey = publicKey, kind = ChatMessageRelayListEvent.KIND, tags = ChatMessageRelayListEvent.createTagArray( - _root_ide_package_.at.torch.compose.nostr.Relays.DefaultDMRelayList + Relays.DefaultDMRelayList ), content = "" ) @@ -189,7 +189,7 @@ class DatabaseNostrRepository( tags = arrayOf( AltTag.assemble(RelayFeedsListEvent.ALT) ), - privateTags = _root_ide_package_.at.torch.compose.nostr.Relays.DefaultGlobalRelays.map { + privateTags = Relays.DefaultGlobalRelays.map { RelayTag.assemble( it ) @@ -199,7 +199,7 @@ class DatabaseNostrRepository( ) // KeyPackage... - val slot = KeyPackageUtils.PRIMARY_SLOT + KeyPackageUtils.PRIMARY_SLOT val dTag = KeyPackageUtils.generateRandomDTag() // TODO: Persist this... val identity = publicKey.hexToByteArray() val bundle = generateKeyPackage(identity, dTag) @@ -312,7 +312,7 @@ class DatabaseNostrRepository( val profileEventTemplate = MetadataEvent.createNew() saveUnsignedNostrEvent( - _root_ide_package_.at.torch.compose.database.model.UnsignedNostrEvent( + UnsignedNostrEvent( pubKey = publicKey, kind = profileEventTemplate.kind, createdAt = Instant.fromEpochSeconds(profileEventTemplate.createdAt), @@ -417,7 +417,7 @@ class DatabaseNostrRepository( val unsignedNostrEvent = saveUnsignedNostrEvent( - _root_ide_package_.at.torch.compose.database.model.UnsignedNostrEvent( + UnsignedNostrEvent( pubKey = publicKey, kind = textNote.kind, createdAt = Instant.fromEpochSeconds(textNote.createdAt), @@ -441,7 +441,7 @@ class DatabaseNostrRepository( } } - override suspend fun saveUnsignedNostrEvent(unsignedNostrEvent: at.torch.compose.database.model.UnsignedNostrEvent): at.torch.compose.database.model.UnsignedNostrEvent? = try { + override suspend fun saveUnsignedNostrEvent(unsignedNostrEvent: UnsignedNostrEvent): UnsignedNostrEvent? = try { logger.d("Save unsigned: ${unsignedNostrEvent.kind}") // TODO: We can actually check the unsignedNostrEvent.pubKey for support... if it's writeable if (unsignedNostrEvent.kind == MetadataEvent.KIND){ @@ -456,7 +456,7 @@ class DatabaseNostrRepository( null } - override suspend fun saveUnsignedNostrEvents(unsignedNostrEvents: List) { + override suspend fun saveUnsignedNostrEvents(unsignedNostrEvents: List) { logger.d("saveUnsignedNostrEvents: $unsignedNostrEvents") delay(2_100) @@ -470,7 +470,7 @@ class DatabaseNostrRepository( } override suspend fun publishNostrEvent( - unsignedNostrEvent: at.torch.compose.database.model.UnsignedNostrEvent, + unsignedNostrEvent: UnsignedNostrEvent, nostrEvent: at.torch.compose.database.model.NostrEvent, relayURLs: List, activeKeyPair: KeyPair diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/repository/DatabasePostRepository.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/repository/DatabasePostRepository.kt index 556e504c..77226a13 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/repository/DatabasePostRepository.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/repository/DatabasePostRepository.kt @@ -2,6 +2,4 @@ package at.torch.compose.database.repository class DatabasePostRepository( private val database: at.torch.compose.database.TorchDatabase -): at.torch.compose.repository.PostRepository { - -} \ No newline at end of file +): at.torch.compose.repository.PostRepository \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/GiftWrapImpersonationException.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/GiftWrapImpersonationException.kt index d0a84d0d..75ba9e61 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/GiftWrapImpersonationException.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/GiftWrapImpersonationException.kt @@ -1,4 +1,3 @@ package at.torch.compose.exceptions -open class GiftWrapImpersonationException(message: String? = null, cause: Throwable? = null) : Exception(message, cause) { -} \ No newline at end of file +open class GiftWrapImpersonationException(message: String? = null, cause: Throwable? = null) : Exception(message, cause) \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/GiftWrapSealDecryptionException.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/GiftWrapSealDecryptionException.kt index d255b77d..883b3508 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/GiftWrapSealDecryptionException.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/GiftWrapSealDecryptionException.kt @@ -1,4 +1,3 @@ package at.torch.compose.exceptions -open class GiftWrapSealDecryptionException(message: String? = null, cause: Throwable? = null) : Exception(message, cause) { -} \ No newline at end of file +open class GiftWrapSealDecryptionException(message: String? = null, cause: Throwable? = null) : Exception(message, cause) \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/GiftWrapUnsealException.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/GiftWrapUnsealException.kt index 555b1cd7..c4d075fa 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/GiftWrapUnsealException.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/GiftWrapUnsealException.kt @@ -1,4 +1,3 @@ package at.torch.compose.exceptions -open class GiftWrapUnsealException(message: String? = null, cause: Throwable? = null) : Exception(message, cause) { -} \ No newline at end of file +open class GiftWrapUnsealException(message: String? = null, cause: Throwable? = null) : Exception(message, cause) \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/SignatureException.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/SignatureException.kt index 99005360..8523bae8 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/SignatureException.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/SignatureException.kt @@ -1,4 +1,3 @@ package at.torch.compose.exceptions -open class SignatureException(message: String? = null, cause: Throwable? = null) : Exception(message, cause) { -} \ No newline at end of file +open class SignatureException(message: String? = null, cause: Throwable? = null) : Exception(message, cause) \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/SigningKeyNotFoundException.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/SigningKeyNotFoundException.kt index 368f3821..092cff26 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/SigningKeyNotFoundException.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/SigningKeyNotFoundException.kt @@ -4,5 +4,3 @@ class SigningKeyNotFoundException(message: String? = null, cause: Throwable? = n message, cause, ) -{ -} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/SigningRejectedException.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/SigningRejectedException.kt index 3eaed748..7fd60b01 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/SigningRejectedException.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/exceptions/SigningRejectedException.kt @@ -1,4 +1,3 @@ package at.torch.compose.exceptions -class SigningRejectedException(message: String? = null, cause: Throwable? = null) : SignatureException(message, cause) { -} \ No newline at end of file +class SigningRejectedException(message: String? = null, cause: Throwable? = null) : SignatureException(message, cause) \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/managers/AuxDatabaseManager.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/managers/AuxDatabaseManager.kt index 2bce5fe1..fc59592d 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/managers/AuxDatabaseManager.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/managers/AuxDatabaseManager.kt @@ -5,7 +5,7 @@ class AuxDatabaseManager( ) { val auxDatabase by lazy { _root_ide_package_.at.torch.compose.database.builder.getRoomDatabase( - _root_ide_package_.at.torch.compose.database.builder.PlatformDatabaseBuilder.getDatabaseBuilder( + at.torch.compose.database.builder.PlatformDatabaseBuilder.getDatabaseBuilder( torchGlobal.platformContext ) ) @@ -18,7 +18,7 @@ class AuxDatabaseManager( */ val inMemoryAuxDatabase by lazy { _root_ide_package_.at.torch.compose.database.builder.getRoomDatabase( - _root_ide_package_.at.torch.compose.database.builder.PlatformDatabaseBuilder.getInMemoryDatabaseBuilder( + at.torch.compose.database.builder.PlatformDatabaseBuilder.getInMemoryDatabaseBuilder( torchGlobal.platformContext ) ) diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/network/relays/RelayPool.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/network/relays/RelayPool.kt index 8850f636..1e2ebcac 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/network/relays/RelayPool.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/network/relays/RelayPool.kt @@ -157,7 +157,7 @@ class RelayPool( ) } - @Throws(_root_ide_package_.at.torch.compose.exceptions.NostrPublishException::class) + @Throws(at.torch.compose.exceptions.NostrPublishException::class) suspend fun publishEvent(nostrEvent: at.torch.compose.database.model.NostrEvent, relays: Set = emptySet()): Flow { val relayUrls = relays.map { NormalizedRelayUrl(it.url).displayUrl() } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/network/relays/RelaysSocketManager.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/network/relays/RelaysSocketManager.kt index 057d33fa..b2104762 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/network/relays/RelaysSocketManager.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/network/relays/RelaysSocketManager.kt @@ -27,7 +27,7 @@ import kotlinx.coroutines.sync.withLock * * https://github.com/PrimalHQ/primal-android-app/blob/6db2e6862239335dede4162338d7c4f10ad35031/app/src/main/kotlin/net/primal/android/networking/relays/RelaysSocketManager.kt */ -class RelaysSocketManager constructor( +class RelaysSocketManager( private val activeWalletStateFlow: StateFlow, private val nostrSocketClientFactory: at.torch.compose.network.sockets.NostrSocketClientFactory, private val cachingImportRepository: at.torch.compose.repository.CachingImportRepository, @@ -101,7 +101,7 @@ class RelaysSocketManager constructor( relayPool.closePool() } - @Throws(_root_ide_package_.at.torch.compose.exceptions.NostrPublishException::class) + @Throws(at.torch.compose.exceptions.NostrPublishException::class) suspend fun publishEvent(nostrEvent: at.torch.compose.database.model.NostrEvent): Flow { return if (userRelays.isNotEmpty()) { relayPool.publishEvent( @@ -116,7 +116,7 @@ class RelaysSocketManager constructor( } } - @Throws(_root_ide_package_.at.torch.compose.exceptions.NostrPublishException::class) + @Throws(at.torch.compose.exceptions.NostrPublishException::class) suspend fun publishEvent(nostrEvent: at.torch.compose.database.model.NostrEvent, relays: Set): Flow { logger.d("publishEvent: $nostrEvent") return relayPool.publishEvent( diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/network/sockets/NostrIncomingMessageParser.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/network/sockets/NostrIncomingMessageParser.kt index 26efbb3e..dd0d5591 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/network/sockets/NostrIncomingMessageParser.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/network/sockets/NostrIncomingMessageParser.kt @@ -74,7 +74,7 @@ private fun JsonArray.takeAsEventIncomingMessage(): NostrIncomingMessage? { if (subscriptionId == null || kind == null) return null - val nostrEvent = _root_ide_package_.at.torch.compose.database.model.NostrEvent.Companion.fromEvent( + val nostrEvent = at.torch.compose.database.model.NostrEvent.fromEvent( Event.fromJson( event.toString() ) @@ -95,7 +95,7 @@ private fun JsonArray.takeAsEventsIncomingMessage(): NostrIncomingMessage? { val nostrEvents = mutableListOf() events.map { it.jsonObject }.forEach { jsonEvent -> - _root_ide_package_.at.torch.compose.database.model.NostrEvent.Companion.fromEvent( + at.torch.compose.database.model.NostrEvent.fromEvent( Event.fromJson( jsonEvent.toString() ) diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/network/sockets/NostrSocketClientFactory.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/network/sockets/NostrSocketClientFactory.kt index cb4f1d26..88cd6386 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/network/sockets/NostrSocketClientFactory.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/network/sockets/NostrSocketClientFactory.kt @@ -7,7 +7,7 @@ import kotlinx.serialization.json.Json internal val defaultSocketsHttpClient by lazy { - HttpClient() { + HttpClient { install(WebSockets) { contentConverter = KotlinxWebsocketSerializationConverter(Json { isLenient = true diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/repository/NostrNotaryRepository.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/repository/NostrNotaryRepository.kt index 4d95fe41..227ac1e6 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/repository/NostrNotaryRepository.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/repository/NostrNotaryRepository.kt @@ -70,7 +70,7 @@ class NostrNotaryRepository( walletManager.keyManager.value?.nostrPrivateKey()?.value?.toByteArray()?.toNsec() }.getOrNull() ?: throw _root_ide_package_.at.torch.compose.exceptions.SigningKeyNotFoundException() - private fun signNostrEvent(publicKey: String, event: at.torch.compose.database.model.UnsignedNostrEvent): at.torch.compose.database.model.NostrEvent? { + private fun signNostrEvent(publicKey: String, event: at.torch.compose.database.model.UnsignedNostrEvent): at.torch.compose.database.model.NostrEvent { val isExternalSignerLogin = runCatching { // credentialsStore.isExternalSignerCredential(npub = publicKey.hexToNpubHrp()) false @@ -100,7 +100,7 @@ class NostrNotaryRepository( } ) } - .toTypedArray() + listOf(_root_ide_package_.at.torch.compose.network.UserAgent.CLIENT_NAME.asClientTag()), + .toTypedArray() + listOf(at.torch.compose.network.UserAgent.CLIENT_NAME.asClientTag()), ), ) } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/repository/NostrPublisherRepository.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/repository/NostrPublisherRepository.kt index a138f965..53e84579 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/repository/NostrPublisherRepository.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/repository/NostrPublisherRepository.kt @@ -30,7 +30,7 @@ class NostrPublisherRepository( } } - @Throws(_root_ide_package_.at.torch.compose.exceptions.NostrPublishException::class) + @Throws(at.torch.compose.exceptions.NostrPublishException::class) private suspend fun publishAndImportEvent(signedNostrEvent: at.torch.compose.database.model.NostrEvent, outboxRelays: List = emptyList()) { relaysSocketManager.publishEvent(signedNostrEvent) importEvent(signedNostrEvent) @@ -52,7 +52,7 @@ class NostrPublisherRepository( } } - @Throws(_root_ide_package_.at.torch.compose.exceptions.NostrPublishException::class, _root_ide_package_.at.torch.compose.exceptions.SignatureException::class) + @Throws(at.torch.compose.exceptions.NostrPublishException::class, at.torch.compose.exceptions.SignatureException::class) suspend fun signPublishImportNostrEvent( unsignedNostrEvent: at.torch.compose.database.model.UnsignedNostrEvent, outboxRelays: List, @@ -63,7 +63,7 @@ class NostrPublisherRepository( } - @Throws(_root_ide_package_.at.torch.compose.exceptions.NostrPublishException::class, _root_ide_package_.at.torch.compose.exceptions.SignatureException::class) + @Throws(at.torch.compose.exceptions.NostrPublishException::class, at.torch.compose.exceptions.SignatureException::class) suspend fun publishRelayList(userId: String, relays: List): at.torch.compose.database.model.NostrEvent { val signedNostrEvent = nostrNotary.signRelayListMetadata(userId = userId, relays = relays).unwrapOrThrow() relaysSocketManager.publishEvent(nostrEvent = signedNostrEvent, relays = relays.toSet()) diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/repository/PostRepository.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/repository/PostRepository.kt index dc6004d0..a1b88978 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/repository/PostRepository.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/repository/PostRepository.kt @@ -1,4 +1,3 @@ package at.torch.compose.repository -interface PostRepository { -} \ No newline at end of file +interface PostRepository \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/BlurHashDecoder.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/BlurHashDecoder.kt index eb61deaa..c3f5d6fd 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/BlurHashDecoder.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/BlurHashDecoder.kt @@ -16,7 +16,7 @@ object BlurHashDecoder { if (blurHash.length != 4 + 2 * nx * ny) return null val maxAc = (decode83(blurHash, 1, 2) + 1) / 166f - val colors = Array(nx * ny) { i -> + Array(nx * ny) { i -> if (i == 0) { val color83 = decode83(blurHash, 2, 6) decodeDc(color83) diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/ChatRoomDetailScreen.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/ChatRoomDetailScreen.kt index c0452b21..327ce4e8 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/ChatRoomDetailScreen.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/ChatRoomDetailScreen.kt @@ -46,7 +46,7 @@ fun ChatRoomDetailScreen( activeUserPublicKey: HexKey, chatRoomId: String, relayHint: String?, - initialChatRoomDetailUIState: at.torch.compose.ui.view.state.ChatRoomDetailUIState = _root_ide_package_.at.torch.compose.ui.view.state.ChatRoomDetailUIState.Loading, + initialChatRoomDetailUIState: at.torch.compose.ui.view.state.ChatRoomDetailUIState = at.torch.compose.ui.view.state.ChatRoomDetailUIState.Loading, nostrRepository: at.torch.compose.repository.NostrRepository, chatRepository: at.torch.compose.repository.ChatRepository ) { @@ -62,7 +62,7 @@ fun ChatRoomDetailScreen( ) when (val chatRoomDetailUIState = chatRoomDetailViewModel.chatRoomDetailUIState) { - _root_ide_package_.at.torch.compose.ui.view.state.ChatRoomDetailUIState.Error -> { + at.torch.compose.ui.view.state.ChatRoomDetailUIState.Error -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -79,7 +79,7 @@ fun ChatRoomDetailScreen( val textFieldState = rememberTextFieldState() val chatRoomDetailMessageListViewModel: at.torch.compose.ui.view.model.ChatRoomDetailMessageListViewModel = viewModel( - factory = _root_ide_package_.at.torch.compose.ui.view.model.ChatRoomDetailMessageListViewModel.Companion.factory( + factory = at.torch.compose.ui.view.model.ChatRoomDetailMessageListViewModel.factory( localChatRoom = chatRoomDetailUIState.localChatRoom, nostrRepository = nostrRepository, chatRepository = chatRepository @@ -228,7 +228,7 @@ fun ChatRoomDetailScreen( } } } - _root_ide_package_.at.torch.compose.ui.view.state.ChatRoomDetailUIState.Loading -> { + at.torch.compose.ui.view.state.ChatRoomDetailUIState.Loading -> { Column( modifier = Modifier.fillMaxWidth().padding( 20.dp @@ -264,7 +264,7 @@ fun ChatRoomDetailScreen( } LaunchedEffect(true) { - if (initialChatRoomDetailUIState == _root_ide_package_.at.torch.compose.ui.view.state.ChatRoomDetailUIState.Loading) { + if (initialChatRoomDetailUIState == at.torch.compose.ui.view.state.ChatRoomDetailUIState.Loading) { chatRoomDetailViewModel.initiateChatRoomDetail() } } @@ -281,7 +281,7 @@ private fun ChatRoomDetailScreenPreview() { activeUserPublicKey = "", chatRoomId = "publicKey", relayHint = null, - initialChatRoomDetailUIState = _root_ide_package_.at.torch.compose.ui.view.state.ChatRoomDetailUIState.Loaded( + initialChatRoomDetailUIState = at.torch.compose.ui.view.state.ChatRoomDetailUIState.Loaded( localChatRoom = _root_ide_package_.at.torch.compose.database.model.intermdiate.LocalChatRoom( chatRoom = _root_ide_package_.at.torch.compose.database.model.ChatRoom( id = "", @@ -292,8 +292,8 @@ private fun ChatRoomDetailScreenPreview() { ), ) ), - nostrRepository = _root_ide_package_.at.torch.compose.repository.NostrRepository.Companion.NO_OP_NOSTR_REPOSITORY, - chatRepository = _root_ide_package_.at.torch.compose.repository.ChatRepository.Companion.NO_OP_CHAT_REPOSITORY + nostrRepository = at.torch.compose.repository.NostrRepository.NO_OP_NOSTR_REPOSITORY, + chatRepository = at.torch.compose.repository.ChatRepository.NO_OP_CHAT_REPOSITORY ) } } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/CreateProfileScreen.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/CreateProfileScreen.kt index 626432da..82221a4f 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/CreateProfileScreen.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/CreateProfileScreen.kt @@ -65,7 +65,7 @@ fun CreateProfileScreen( ) { when (val createAccountUIState = createProfileViewModel.createProfileUIState.value) { - is at.torch.compose.ui.view.state.CreateProfileUIState.Declaration -> { + is CreateProfileUIState.Declaration -> { Text( "Create Profile", @@ -91,7 +91,7 @@ fun CreateProfileScreen( Button( onClick = { - createProfileViewModel.createProfileUIState.value = _root_ide_package_.at.torch.compose.ui.view.state.CreateProfileUIState.InputPrompt + createProfileViewModel.createProfileUIState.value = CreateProfileUIState.InputPrompt } ) { Text( @@ -99,7 +99,7 @@ fun CreateProfileScreen( ) } } - is at.torch.compose.ui.view.state.CreateProfileUIState.InputPrompt -> { + is CreateProfileUIState.InputPrompt -> { Text( "Create Profile", style = MaterialTheme.typography.headlineSmall @@ -204,7 +204,7 @@ fun CreateProfileScreen( createProfileViewModel.validateInput().let { isInputValid -> if (isInputValid) { createProfileViewModel.createProfileUIState.value = - _root_ide_package_.at.torch.compose.ui.view.state.CreateProfileUIState.ConfirmInput( + CreateProfileUIState.ConfirmInput( name = createProfileViewModel.createProfileFormState.nameField.textFieldState.text.toString(), bio = createProfileViewModel.createProfileFormState.biographyField.textFieldState.text.toString() ) @@ -220,7 +220,7 @@ fun CreateProfileScreen( } } - is at.torch.compose.ui.view.state.CreateProfileUIState.ConfirmInput -> { + is CreateProfileUIState.ConfirmInput -> { Text( text = "Name", @@ -278,7 +278,7 @@ fun CreateProfileScreen( } } - is at.torch.compose.ui.view.state.CreateProfileUIState.Error -> { + is CreateProfileUIState.Error -> { Spacer( modifier = Modifier.weight(1f) ) @@ -291,7 +291,7 @@ fun CreateProfileScreen( modifier = Modifier.weight(1f) ) } - is at.torch.compose.ui.view.state.CreateProfileUIState.ProfileReady -> { + is CreateProfileUIState.ProfileReady -> { Spacer( modifier = Modifier.weight(1f) diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/HomeScreen.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/HomeScreen.kt index c30a6075..849fceb1 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/HomeScreen.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/HomeScreen.kt @@ -41,7 +41,7 @@ import kotlinx.coroutines.launch @Composable fun HomeScreen( activeUserPublicKey: HexKey, - initialHomeScreenUIState: at.torch.compose.ui.view.state.HomeScreenUIState = _root_ide_package_.at.torch.compose.ui.view.state.HomeScreenUIState.Loading, + initialHomeScreenUIState: at.torch.compose.ui.view.state.HomeScreenUIState = at.torch.compose.ui.view.state.HomeScreenUIState.Loading, onNavigateToEvent: (at.torch.compose.ui.composable.navigation.routes.Route) -> Unit, onNavigateToDirectMessageDetail: (at.torch.compose.ui.composable.navigation.routes.Route) -> Unit, onNavigateToChatRoomCreation: () -> Unit, @@ -52,16 +52,16 @@ fun HomeScreen( val scope = rememberCoroutineScope() val homeScreenViewModel: at.torch.compose.ui.view.model.HomeViewModel = viewModel( - factory = _root_ide_package_.at.torch.compose.ui.view.model.HomeViewModel.Companion.factory( + factory = at.torch.compose.ui.view.model.HomeViewModel.factory( activeUserPublicKey = activeUserPublicKey, initialHomeScreenUIState = initialHomeScreenUIState, nostrRepository = nostrRepository, - pagerState = rememberPagerState { _root_ide_package_.at.torch.compose.ui.view.model.HomeScreenType.entries.size } + pagerState = rememberPagerState { HomeScreenType.entries.size } ), ) when(val homeScreenUIState = homeScreenViewModel.homeScreenUIState) { - _root_ide_package_.at.torch.compose.ui.view.state.HomeScreenUIState.Error -> { + at.torch.compose.ui.view.state.HomeScreenUIState.Error -> { Scaffold { innerPadding -> Column( modifier = Modifier.padding(innerPadding).fillMaxSize(), @@ -180,8 +180,8 @@ fun HomeScreen( HomeScreenType.Messages -> { val chatRoomListViewModel: at.torch.compose.ui.view.model.ChatRoomListViewModel = viewModel( key = homeScreenTypeType.name, - factory = _root_ide_package_.at.torch.compose.ui.view.model.ChatRoomListViewModel.Companion.factory( - initialChatRoomListUIState = _root_ide_package_.at.torch.compose.ui.view.state.ChatRoomListUIState.Loading, + factory = at.torch.compose.ui.view.model.ChatRoomListViewModel.factory( + initialChatRoomListUIState = at.torch.compose.ui.view.state.ChatRoomListUIState.Loading, publicKey = homeScreenUIState.profileWithFollowing.profile.publicKey, synchronizationFilter = homeScreenViewModel.getSynchronizationFilter( homeScreenTypeType, @@ -208,7 +208,7 @@ fun HomeScreen( } } } - _root_ide_package_.at.torch.compose.ui.view.state.HomeScreenUIState.Loading -> { + at.torch.compose.ui.view.state.HomeScreenUIState.Loading -> { _root_ide_package_.at.torch.compose.ui.composable.widgets.LoadingDataIndicator() } } @@ -227,7 +227,7 @@ private fun HomeScreenPreview() { ) { HomeScreen( activeUserPublicKey = "", - initialHomeScreenUIState = _root_ide_package_.at.torch.compose.ui.view.state.HomeScreenUIState.Loaded( + initialHomeScreenUIState = at.torch.compose.ui.view.state.HomeScreenUIState.Loaded( profileWithFollowing = _root_ide_package_.at.torch.compose.database.model.intermdiate.LocalProfileWithFollowing( nostrEvent = _root_ide_package_.at.torch.compose.database.model.NostrEvent( id = "eventId", @@ -253,8 +253,8 @@ It has survived not only five centuries, but also the leap into electronic types onNavigateToChatRoomCreation = {}, onNavigateToSearch = {}, onNavigateToDirectMessageDetail = {}, - nostrRepository = _root_ide_package_.at.torch.compose.repository.NostrRepository.Companion.NO_OP_NOSTR_REPOSITORY, - chatRepository = _root_ide_package_.at.torch.compose.repository.ChatRepository.Companion.NO_OP_CHAT_REPOSITORY + nostrRepository = at.torch.compose.repository.NostrRepository.NO_OP_NOSTR_REPOSITORY, + chatRepository = at.torch.compose.repository.ChatRepository.NO_OP_CHAT_REPOSITORY ) } } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/NostrEventDetailScreen.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/NostrEventDetailScreen.kt index 49c5225a..a8856577 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/NostrEventDetailScreen.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/NostrEventDetailScreen.kt @@ -35,7 +35,7 @@ fun NostrEventDetailScreen( onNavigateToQuoteNostrEvent: (String) -> Unit, ) { val nostrEventDetailViewModel: at.torch.compose.ui.view.model.NostrEventDetailViewModel = viewModel( - factory = _root_ide_package_.at.torch.compose.ui.view.model.NostrEventDetailViewModel.Companion.factory( + factory = at.torch.compose.ui.view.model.NostrEventDetailViewModel.factory( nostrEventId = nostrEventId, initialNostrEventDetailUIState = initialNostrEventDetailUIState, nostrRepository = nostrRepository, @@ -44,7 +44,7 @@ fun NostrEventDetailScreen( ) when(val feedListUIState = nostrEventDetailViewModel.nostrEventDetailUIState) { - _root_ide_package_.at.torch.compose.ui.view.state.NostrEventDetailUIState.Error -> { + at.torch.compose.ui.view.state.NostrEventDetailUIState.Error -> { Column( modifier = Modifier.fillMaxSize(), verticalArrangement = Arrangement.Center, @@ -107,14 +107,14 @@ fun NostrEventDetailScreen( } } } - _root_ide_package_.at.torch.compose.ui.view.state.NostrEventDetailUIState.Loading -> { + at.torch.compose.ui.view.state.NostrEventDetailUIState.Loading -> { _root_ide_package_.at.torch.compose.ui.composable.widgets.LoadingDataIndicator() LaunchedEffect(true) { nostrEventDetailViewModel.loadNostrFeed() } } - _root_ide_package_.at.torch.compose.ui.view.state.NostrEventDetailUIState.NotFound -> { + at.torch.compose.ui.view.state.NostrEventDetailUIState.NotFound -> { Column( modifier = Modifier.fillMaxSize(), verticalArrangement = Arrangement.Center, @@ -134,7 +134,7 @@ private fun NostrEventDetailScreenPreview() { modifier = Modifier.padding(20.dp) ) { NostrEventDetailScreen( - initialNostrEventDetailUIState = _root_ide_package_.at.torch.compose.ui.view.state.NostrEventDetailUIState.Loaded( + initialNostrEventDetailUIState = at.torch.compose.ui.view.state.NostrEventDetailUIState.Loaded( localNostrEvent = _root_ide_package_.at.torch.compose.database.model.intermdiate.LocalNostrEvent( nostrEvent = _root_ide_package_.at.torch.compose.database.model.NostrEvent( id = "eventId", @@ -157,7 +157,7 @@ It has survived not only five centuries, but also the leap into electronic types ), nostrEventId = "", activeUserPublicKey = "", - nostrRepository = _root_ide_package_.at.torch.compose.repository.NostrRepository.Companion.NO_OP_NOSTR_REPOSITORY, + nostrRepository = at.torch.compose.repository.NostrRepository.NO_OP_NOSTR_REPOSITORY, onNavigateBack = {}, onNavigateToEvent = {}, onNavigateToWriteAReply = {}, diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SearchResultScreen.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SearchResultScreen.kt index 50a06562..65f94d2f 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SearchResultScreen.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SearchResultScreen.kt @@ -65,8 +65,8 @@ fun SearchResultScreen( val scope = rememberCoroutineScope() val searchViewModel: at.torch.compose.ui.view.model.SearchResultViewModel = viewModel( - factory = _root_ide_package_.at.torch.compose.ui.view.model.SearchResultViewModel.Companion.factory( - initialSearchResultType = _root_ide_package_.at.torch.compose.ui.view.model.SearchResultType.Profiles, + factory = at.torch.compose.ui.view.model.SearchResultViewModel.factory( + initialSearchResultType = at.torch.compose.ui.view.model.SearchResultType.Profiles, searchQuery = searchQuery, nostrRepository = nostrRepository, searchRepository = searchRepository @@ -154,14 +154,14 @@ fun SearchResultScreen( }, windowInsets = TopAppBarDefaults.windowInsets ) { - val pagerState = rememberPagerState { _root_ide_package_.at.torch.compose.ui.view.model.SearchResultType.entries.size } + val pagerState = rememberPagerState { at.torch.compose.ui.view.model.SearchResultType.entries.size } PrimaryScrollableTabRow( modifier = Modifier, edgePadding = 10.dp, selectedTabIndex = searchViewModel.searchResultType.ordinal, ) { - _root_ide_package_.at.torch.compose.ui.view.model.SearchResultType.entries.forEach { searchResultType -> + at.torch.compose.ui.view.model.SearchResultType.entries.forEach { searchResultType -> Tab( selected = searchViewModel.searchResultType == searchResultType, onClick = { @@ -194,14 +194,14 @@ fun SearchResultScreen( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally ) { - when(_root_ide_package_.at.torch.compose.ui.view.model.SearchResultType.entries[pageIndex]) { - _root_ide_package_.at.torch.compose.ui.view.model.SearchResultType.Profiles -> { + when(at.torch.compose.ui.view.model.SearchResultType.entries[pageIndex]) { + at.torch.compose.ui.view.model.SearchResultType.Profiles -> { Text("Profiles") } } when (val searchResultListUIState = searchViewModel.searchResultListUIState) { - _root_ide_package_.at.torch.compose.ui.view.state.SearchResultListUIState.Error -> { + at.torch.compose.ui.view.state.SearchResultListUIState.Error -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -254,7 +254,7 @@ fun SearchResultScreen( } } - _root_ide_package_.at.torch.compose.ui.view.state.SearchResultListUIState.Loading -> { + at.torch.compose.ui.view.state.SearchResultListUIState.Loading -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -296,8 +296,8 @@ private fun SearchResultScreenPreview() { SearchResultScreen( activeUserPublicKey = "", searchQuery = "What happened...", - nostrRepository = _root_ide_package_.at.torch.compose.repository.NostrRepository.Companion.NO_OP_NOSTR_REPOSITORY, - searchRepository = _root_ide_package_.at.torch.compose.repository.SearchRepository.Companion.NO_OP_SEARCH_REPOSITORY, + nostrRepository = at.torch.compose.repository.NostrRepository.NO_OP_NOSTR_REPOSITORY, + searchRepository = at.torch.compose.repository.SearchRepository.NO_OP_SEARCH_REPOSITORY, onNavigateBack = {}, onNavigateToEvent = {} ) diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SearchScreen.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SearchScreen.kt index cbe1219f..86c5620b 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SearchScreen.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SearchScreen.kt @@ -63,7 +63,7 @@ fun SearchScreen( onNavigateToProfile: (at.torch.compose.ui.composable.navigation.routes.Route) -> Unit ) { val searchViewModel: at.torch.compose.ui.view.model.SearchViewModel = viewModel( - factory = _root_ide_package_.at.torch.compose.ui.view.model.SearchViewModel.Companion.factory( + factory = at.torch.compose.ui.view.model.SearchViewModel.factory( initialSearchUIState = initialSearchUIState, nostrRepository = nostrRepository, searchRepository = searchRepository @@ -235,7 +235,7 @@ fun SearchScreen( supportingContent = { Text( text = profile.staticIdentifier() ?: "", - color = _root_ide_package_.at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(profile.publicKey), + color = at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(profile.publicKey), maxLines = 1, ) }, @@ -307,7 +307,7 @@ fun SearchScreen( Text( text = profile.humanReadableNameOrPubkey(), - color = _root_ide_package_.at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(profile.publicKey), + color = at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(profile.publicKey), overflow = TextOverflow.Ellipsis, maxLines = 1, style = MaterialTheme.typography.labelSmall @@ -407,9 +407,9 @@ private fun SearchScreenPreview() { ) { SearchScreen( activeUserPublicKey = "", - initialSearchUIState = _root_ide_package_.at.torch.compose.ui.view.state.SearchUIState.Prompt, - nostrRepository = _root_ide_package_.at.torch.compose.repository.NostrRepository.Companion.NO_OP_NOSTR_REPOSITORY, - searchRepository = _root_ide_package_.at.torch.compose.repository.SearchRepository.Companion.NO_OP_SEARCH_REPOSITORY, + initialSearchUIState = at.torch.compose.ui.view.state.SearchUIState.Prompt, + nostrRepository = at.torch.compose.repository.NostrRepository.NO_OP_NOSTR_REPOSITORY, + searchRepository = at.torch.compose.repository.SearchRepository.NO_OP_SEARCH_REPOSITORY, onNavigateToSearchResult = {}, onNavigateToProfile = {} ) diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SignInScreen.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SignInScreen.kt index 5708dfe7..f1d8121a 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SignInScreen.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SignInScreen.kt @@ -34,11 +34,11 @@ import com.vitorpamplona.quartz.nip19Bech32.entities.NSec @OptIn(ExperimentalMaterial3ExpressiveApi::class) @Composable fun SignInToProfileScreen( - initialSignInToProfileUIState: at.torch.compose.ui.view.state.SignInToProfileUIState = _root_ide_package_.at.torch.compose.ui.view.state.SignInToProfileUIState.InputPrompt, + initialSignInToProfileUIState: at.torch.compose.ui.view.state.SignInToProfileUIState = at.torch.compose.ui.view.state.SignInToProfileUIState.InputPrompt, nostrRepository: at.torch.compose.repository.NostrRepository ) { val signInToProfileViewModel: at.torch.compose.ui.view.model.SignInToProfileViewModel = viewModel ( - factory = _root_ide_package_.at.torch.compose.ui.view.model.SignInToProfileViewModel.Companion.factory( + factory = at.torch.compose.ui.view.model.SignInToProfileViewModel.factory( initialSignInToProfileUIState, nostrRepository ) @@ -106,19 +106,19 @@ fun SignInToProfileScreen( signInToProfileViewModel.signInToProfileUIState.value = signInToProfileViewModel.validateCredential().let { credentialEntity -> when (credentialEntity) { is NSec -> { - _root_ide_package_.at.torch.compose.ui.view.state.SignInToProfileUIState.ConfirmNsecSignIn( + at.torch.compose.ui.view.state.SignInToProfileUIState.ConfirmNsecSignIn( nsec = signInToProfileViewModel.signInToProfileFormState.textField.textFieldState.text.toString(), hexKey = credentialEntity.hex ) } is NPub -> { - _root_ide_package_.at.torch.compose.ui.view.state.SignInToProfileUIState.ConfirmNpubSignIn( + at.torch.compose.ui.view.state.SignInToProfileUIState.ConfirmNpubSignIn( npub = signInToProfileViewModel.signInToProfileFormState.textField.textFieldState.text.toString(), hexKey = credentialEntity.hex ) } else -> { - _root_ide_package_.at.torch.compose.ui.view.state.SignInToProfileUIState.Error + at.torch.compose.ui.view.state.SignInToProfileUIState.Error } } } @@ -260,7 +260,7 @@ private fun SignInToProfileScreenPreview() { ) { SignInToProfileScreen( initialSignInToProfileUIState = - _root_ide_package_.at.torch.compose.ui.view.state.SignInToProfileUIState.InputPrompt, + at.torch.compose.ui.view.state.SignInToProfileUIState.InputPrompt, // SignInToProfileUIState.Error, // SignInToProfileUIState.ConfirmNpubSignIn( // npub = "npub1uh366qnj68a7atvwgwdy4569xd6v5jtferftapqztwjwlzh9553q47pqsx", @@ -270,7 +270,7 @@ private fun SignInToProfileScreenPreview() { // nsec = "nsecthingsaretobekeptsecret", // hexKey = "e5e3ad0272d1fbeead8e439a4ad3453374ca4969c8d2be84025ba4ef8ae5a522" // ), - nostrRepository = _root_ide_package_.at.torch.compose.repository.NostrRepository.Companion.NO_OP_NOSTR_REPOSITORY + nostrRepository = at.torch.compose.repository.NostrRepository.NO_OP_NOSTR_REPOSITORY ) } } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SovereignWalletStartupScreen.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SovereignWalletStartupScreen.kt index 716e6fdb..b2e50155 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SovereignWalletStartupScreen.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/SovereignWalletStartupScreen.kt @@ -35,7 +35,7 @@ fun SovereignWalletStartupScreen( forceWalletId: WalletId?, ) { val sovereignWalletStartupViewModel = viewModel( - factory = _root_ide_package_.at.torch.compose.ui.view.model.SovereignWalletStartupViewModel.Companion.factory( + factory = at.torch.compose.ui.view.model.SovereignWalletStartupViewModel.factory( phoenixGlobal = sovereignWalletViewModel.phoenixGlobal, ) ) diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/UnqueuedProfileSynchronizationScreen.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/UnqueuedProfileSynchronizationScreen.kt index c81f3c82..7b2fbb11 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/UnqueuedProfileSynchronizationScreen.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/UnqueuedProfileSynchronizationScreen.kt @@ -28,7 +28,7 @@ fun UnqueuedProfileSynchronizationScreen( nostrRepository: at.torch.compose.repository.NostrRepository ) { val unqueuedProfileSynchronizationViewModel: at.torch.compose.ui.view.model.UnqueuedProfileSynchronizationViewModel = viewModel( - factory = _root_ide_package_.at.torch.compose.ui.view.model.UnqueuedProfileSynchronizationViewModel.Companion.factory( + factory = at.torch.compose.ui.view.model.UnqueuedProfileSynchronizationViewModel.factory( unsignedNostrEventId = unsignedNostrEventId, profilePublicKey = profilePublicKey, nostrRepository = nostrRepository @@ -89,7 +89,7 @@ private fun UnqueuedProfileSynchronizationScreenPreview() { UnqueuedProfileSynchronizationScreen( unsignedNostrEventId = 2, profilePublicKey = "npub is for living.", - nostrRepository = _root_ide_package_.at.torch.compose.repository.NostrRepository.Companion.NO_OP_NOSTR_REPOSITORY + nostrRepository = at.torch.compose.repository.NostrRepository.NO_OP_NOSTR_REPOSITORY ) } } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/WriteNewNoteScreen.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/WriteNewNoteScreen.kt index 03b38694..d047b200 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/WriteNewNoteScreen.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/WriteNewNoteScreen.kt @@ -48,7 +48,7 @@ import kotlin.time.Clock @Composable fun WriteNewNoteScreen( activeUserPublicKey: HexKey, - initialWriteNewNoteUIState: at.torch.compose.ui.view.state.WriteNewNoteUIState = _root_ide_package_.at.torch.compose.ui.view.state.WriteNewNoteUIState.Loading, + initialWriteNewNoteUIState: at.torch.compose.ui.view.state.WriteNewNoteUIState = at.torch.compose.ui.view.state.WriteNewNoteUIState.Loading, replyToNostrEventId: HexKey?, quotedNostrEventId: HexKey?, onNostrEventPublished: () -> Unit, @@ -56,7 +56,7 @@ fun WriteNewNoteScreen( nostrRepository: at.torch.compose.repository.NostrRepository ) { val writeNewNoteViewModel: at.torch.compose.ui.view.model.WriteNewNoteViewModel = viewModel ( - factory = _root_ide_package_.at.torch.compose.ui.view.model.WriteNewNoteViewModel.Companion.factory( + factory = at.torch.compose.ui.view.model.WriteNewNoteViewModel.factory( activeUserPublicKey = activeUserPublicKey, replyToNostrEventId = replyToNostrEventId, quotedNostrEventId = quotedNostrEventId, @@ -175,7 +175,7 @@ fun WriteNewNoteScreen( }, outputTransformation = OutputTransformation { val content = originalText.toString() - val nostrProfiles = _root_ide_package_.at.torch.compose.ui.composable.widgets.content.ContentParser.parse(content.trimEnd('\n', '\r'), emptyMap(), emptyMap(), trimBlankLines = true) + val nostrProfiles = at.torch.compose.ui.composable.widgets.content.ContentParser.parse(content.trimEnd('\n', '\r'), emptyMap(), emptyMap(), trimBlankLines = true) .filterIsInstance() // TODO: We might want to order these profiles by the startIndex so that we can replace the better @@ -192,7 +192,7 @@ fun WriteNewNoteScreen( addStyle( SpanStyle( - color = _root_ide_package_.at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(mentionedProfile.publicKey) + color = at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(mentionedProfile.publicKey) ), nostrProfile.startIndex, nostrProfile.startIndex + profileMention.length @@ -452,7 +452,7 @@ private fun WriteNewNoteScreenPreview() { replyToNostrEventId = null, quotedNostrEventId = null, initialWriteNewNoteUIState = - _root_ide_package_.at.torch.compose.ui.view.state.WriteNewNoteUIState.InputPrompt( + at.torch.compose.ui.view.state.WriteNewNoteUIState.InputPrompt( // text = "Yes, I did it. So WHAT?!", inReplyToNostrEvent = _root_ide_package_.at.torch.compose.database.model.intermdiate.LocalNostrEvent( nostrEvent = _root_ide_package_.at.torch.compose.database.model.NostrEvent( @@ -497,7 +497,7 @@ It has survived not only five centuries, but also the leap into electronic types ), onNostrEventPublished = {}, onNavigateToNostrEvent = {}, - nostrRepository = _root_ide_package_.at.torch.compose.repository.NostrRepository.Companion.NO_OP_NOSTR_REPOSITORY + nostrRepository = at.torch.compose.repository.NostrRepository.NO_OP_NOSTR_REPOSITORY ) } } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/TorchNavHost.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/TorchNavHost.kt index bc8e4dbf..f17d2a3d 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/TorchNavHost.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/TorchNavHost.kt @@ -16,6 +16,7 @@ import at.torch.compose.database.repository.DatabaseMarmotRepository import at.torch.compose.ui.composable.ChatRoomCreationScreen import at.torch.compose.ui.composable.ChatRoomDetailScreen import at.torch.compose.ui.composable.HomeScreen +import at.torch.compose.ui.composable.UnsyncedProfileScreen import at.torch.compose.ui.composable.navigation.routes.ChatRoomCreationRoute import at.torch.compose.ui.composable.navigation.routes.WriteNewNoteRoute import co.touchlab.kermit.Logger @@ -69,14 +70,14 @@ fun TorchNavHost( database = auxDatabaseManager.auxDatabase ) - val sovereignWalletViewModel: at.torch.compose.ui.view.model.SovereignWalletViewModel = viewModel(factory = _root_ide_package_.at.torch.compose.ui.view.model.SovereignWalletViewModel.Companion.factory( + val sovereignWalletViewModel: at.torch.compose.ui.view.model.SovereignWalletViewModel = viewModel(factory = at.torch.compose.ui.view.model.SovereignWalletViewModel.factory( phoenixGlobal = phoenixGlobal )) val navigationViewModel: at.torch.compose.ui.view.model.NavigationViewModel = viewModel ( - factory = _root_ide_package_.at.torch.compose.ui.view.model.NavigationViewModel.Companion.factory( + factory = at.torch.compose.ui.view.model.NavigationViewModel.factory( activeWallet = sovereignWalletViewModel.activeWalletInUI, - initialNavigationUIState = _root_ide_package_.at.torch.compose.ui.view.state.NavigationUIState.Loading(), + initialNavigationUIState = at.torch.compose.ui.view.state.NavigationUIState.Loading(), nostrRepository = databaseNostrRepository, scope = applicationIOScope ) @@ -84,7 +85,7 @@ fun TorchNavHost( val notaryViewModel: at.torch.compose.ui.view.model.NotaryViewModel = viewModel( - factory = _root_ide_package_.at.torch.compose.ui.view.model.NotaryViewModel.Companion.factory( + factory = at.torch.compose.ui.view.model.NotaryViewModel.Companion.factory( activeWalletStateFlow = sovereignWalletViewModel.activeWalletInUI, nostrRepository = databaseNostrRepository, chatRepository = databaseChatRepository, @@ -93,7 +94,7 @@ fun TorchNavHost( ) // TODO: Produce a notary UI Element... val synchronizationViewModel: at.torch.compose.ui.view.model.SynchronizationViewModel = viewModel( - factory = _root_ide_package_.at.torch.compose.ui.view.model.SynchronizationViewModel.Companion.factory( + factory = at.torch.compose.ui.view.model.SynchronizationViewModel.Companion.factory( activeWalletStateFlow = sovereignWalletViewModel.activeWalletInUI, nostrRepository = databaseNostrRepository, chatRepository = databaseChatRepository, @@ -117,7 +118,7 @@ fun TorchNavHost( } is at.torch.compose.ui.view.state.NavigationUIState.StartupPhoenix -> { navController.navigate( - route = _root_ide_package_.at.torch.compose.ui.composable.navigation.routes.SovereignWalletStartupRoute + route = at.torch.compose.ui.composable.navigation.routes.SovereignWalletStartupRoute ) { popUpTo(0) } @@ -133,7 +134,7 @@ fun TorchNavHost( } is at.torch.compose.ui.view.state.NavigationUIState.Landing -> { navController.navigate( - route = _root_ide_package_.at.torch.compose.ui.composable.navigation.routes.LandingRoute + route = at.torch.compose.ui.composable.navigation.routes.LandingRoute ) { popUpTo(0) } @@ -229,7 +230,7 @@ fun TorchNavHost( }, onNavigateToWalletIntroPage = { navController.navigate( - route = _root_ide_package_.at.torch.compose.ui.composable.navigation.routes.LandingRoute + route = at.torch.compose.ui.composable.navigation.routes.LandingRoute ) }, onNavigateToWalletDashboard = { @@ -260,7 +261,7 @@ fun TorchNavHost( }, onNavigateToSignIn = { navController.navigate( - route = _root_ide_package_.at.torch.compose.ui.composable.navigation.routes.SignInRoute + route = at.torch.compose.ui.composable.navigation.routes.SignInRoute ) }, onNavigateToCreateProfile = { @@ -274,7 +275,7 @@ fun TorchNavHost( _root_ide_package_.at.torch.compose.ui.composable.CreateProfileScreen( onNavigateToEndThis = { navController.navigate( - route = _root_ide_package_.at.torch.compose.ui.composable.navigation.routes.BlankRoute + route = at.torch.compose.ui.composable.navigation.routes.BlankRoute ) { popUpTo(0) } @@ -291,7 +292,7 @@ fun TorchNavHost( sovereignWalletViewModel.listAvailableWallets { sovereignWalletViewModel.switchToWallet(walletId) navController.navigate( - route = _root_ide_package_.at.torch.compose.ui.composable.navigation.routes.SovereignWalletStartupRoute + route = at.torch.compose.ui.composable.navigation.routes.SovereignWalletStartupRoute ) } } @@ -344,13 +345,13 @@ fun TorchNavHost( ) } composable { backStackEntry -> - val route = backStackEntry.toRoute() + backStackEntry.toRoute() _root_ide_package_.at.torch.compose.ui.composable.UnsignedProfileScreen() } composable { backStackEntry -> val route = backStackEntry.toRoute() - _root_ide_package_.at.torch.compose.ui.composable.UnsyncedProfileScreen( + UnsyncedProfileScreen( unsyncedProfilePublicKey = route.publicKey ) } @@ -369,7 +370,7 @@ fun TorchNavHost( _root_ide_package_.at.torch.compose.ui.composable.UnqueuedProfileScreen() } composable { backStackEntry -> - val route = backStackEntry.toRoute() + backStackEntry.toRoute() _root_ide_package_.at.torch.compose.ui.composable.UnannouncedProfileScreen() } @@ -455,7 +456,7 @@ fun TorchNavHost( _root_ide_package_.at.torch.compose.ui.composable.SearchScreen( activeUserPublicKey = route.activeUserPublicKey, - initialSearchUIState = _root_ide_package_.at.torch.compose.ui.view.state.SearchUIState.Prompt, + initialSearchUIState = at.torch.compose.ui.view.state.SearchUIState.Prompt, nostrRepository = databaseNostrRepository, searchRepository = searchRepository, onNavigateToProfile = { route -> @@ -493,7 +494,7 @@ fun TorchNavHost( _root_ide_package_.at.torch.compose.ui.composable.NostrEventDetailScreen( activeUserPublicKey = route.activeUserPublicKey, - initialNostrEventDetailUIState = _root_ide_package_.at.torch.compose.ui.view.state.NostrEventDetailUIState.Loading, + initialNostrEventDetailUIState = at.torch.compose.ui.view.state.NostrEventDetailUIState.Loading, nostrEventId = route.nostrEventId, nostrRepository = databaseNostrRepository, onNavigateBack = { diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/AuthenticatedProfileRoute.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/AuthenticatedProfileRoute.kt index 0accd5cc..71ca9329 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/AuthenticatedProfileRoute.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/AuthenticatedProfileRoute.kt @@ -3,5 +3,4 @@ package at.torch.compose.ui.composable.navigation.routes import kotlinx.serialization.Serializable @Serializable -data object AuthenticatedProfileRoute { -} \ No newline at end of file +data object AuthenticatedProfileRoute \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/ChatRoomCreationRoute.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/ChatRoomCreationRoute.kt index 2ac49be0..4f868665 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/ChatRoomCreationRoute.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/ChatRoomCreationRoute.kt @@ -5,5 +5,4 @@ import kotlinx.serialization.Serializable @Serializable data class ChatRoomCreationRoute( val activeUserPublicKey: String, -): Route() { -} \ No newline at end of file +): Route() \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/ChatRoomDetailRoute.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/ChatRoomDetailRoute.kt index b77263df..b2617278 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/ChatRoomDetailRoute.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/ChatRoomDetailRoute.kt @@ -7,5 +7,4 @@ data class ChatRoomDetailRoute( val activeUserPublicKey: String, val chatRoomId: String, // TODO: have this as a publicKey val relayHint: String? -): Route() { -} \ No newline at end of file +): Route() \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/CreateProfileRoute.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/CreateProfileRoute.kt index 79bfdab8..23696584 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/CreateProfileRoute.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/CreateProfileRoute.kt @@ -5,5 +5,4 @@ import kotlinx.serialization.Serializable @Serializable data class CreateProfileRoute( val nostrEventId: String? = null, -): Route() { -} \ No newline at end of file +): Route() \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/ImplementationPendingRoute.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/ImplementationPendingRoute.kt index d5db557c..562c1418 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/ImplementationPendingRoute.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/ImplementationPendingRoute.kt @@ -5,5 +5,4 @@ import kotlinx.serialization.Serializable @Serializable data class ImplementationPendingRoute( val name: String -): Route() { -} \ No newline at end of file +): Route() \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/NostrEventDetailRoute.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/NostrEventDetailRoute.kt index 50bda11f..5074f8b4 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/NostrEventDetailRoute.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/NostrEventDetailRoute.kt @@ -6,5 +6,4 @@ import kotlinx.serialization.Serializable data class NostrEventDetailRoute( val activeUserPublicKey: String, val nostrEventId: String, -): Route() { -} \ No newline at end of file +): Route() \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnannouncedProfileRoute.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnannouncedProfileRoute.kt index 9e8e14b3..f09a0848 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnannouncedProfileRoute.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnannouncedProfileRoute.kt @@ -5,5 +5,4 @@ import kotlinx.serialization.Serializable @Serializable data class UnannouncedProfileRoute( val nostrEventId: String, -): Route() { -} \ No newline at end of file +): Route() \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnindexedProfileRoute.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnindexedProfileRoute.kt index e5fbaa5c..c28c612a 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnindexedProfileRoute.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnindexedProfileRoute.kt @@ -5,6 +5,4 @@ import kotlinx.serialization.Serializable @Serializable data class UnindexedProfileRoute( val nostrEventId: String, -): Route() { - -} \ No newline at end of file +): Route() \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnqueuedProfileRoute.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnqueuedProfileRoute.kt index 48ed8c63..da78efd2 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnqueuedProfileRoute.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnqueuedProfileRoute.kt @@ -5,6 +5,4 @@ import kotlinx.serialization.Serializable @Serializable data class UnqueuedProfileRoute( val nostrEventId: String, -): Route() { - -} \ No newline at end of file +): Route() \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnqueuedProfileSynchronizationRoute.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnqueuedProfileSynchronizationRoute.kt index c7f60eb1..897ba8c9 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnqueuedProfileSynchronizationRoute.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnqueuedProfileSynchronizationRoute.kt @@ -6,5 +6,4 @@ import kotlinx.serialization.Serializable data class UnqueuedProfileSynchronizationRoute( val publicKey: String, val unsignedNostrEventId: Long, -): Route() { -} \ No newline at end of file +): Route() \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnsignedProfileRoute.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnsignedProfileRoute.kt index b7e53bb6..85cff4a4 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnsignedProfileRoute.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnsignedProfileRoute.kt @@ -5,5 +5,4 @@ import kotlinx.serialization.Serializable @Serializable data class UnsignedProfileRoute( val unsignedNostrEventId: Long, -): Route() { -} \ No newline at end of file +): Route() \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnsyncedProfileRoute.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnsyncedProfileRoute.kt index 8ccbf8ee..bc2ba384 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnsyncedProfileRoute.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/UnsyncedProfileRoute.kt @@ -5,5 +5,4 @@ import kotlinx.serialization.Serializable @Serializable data class UnsyncedProfileRoute( val publicKey: String, -): Route() { -} \ No newline at end of file +): Route() \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/WriteNewNoteRoute.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/WriteNewNoteRoute.kt index 3e850526..59b6e09b 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/WriteNewNoteRoute.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/navigation/routes/WriteNewNoteRoute.kt @@ -7,5 +7,4 @@ data class WriteNewNoteRoute( val activeUserPublicKey: String, val inReplyToEventId: String? = null, val quotedEventId: String? = null, -): Route() { -} \ No newline at end of file +): Route() \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/ArticleCard.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/ArticleCard.kt index 6d345d80..a3d25581 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/ArticleCard.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/ArticleCard.kt @@ -41,7 +41,7 @@ private fun ArticleCard( val title = remember(event) { event.tags?.firstOrNull { it.size >= 2 && it[0] == "title" }?.get(1) } val summary = remember(event) { event.tags?.firstOrNull { it.size >= 2 && it[0] == "summary" }?.get(1) } - val image = remember(event) { event.tags?.firstOrNull { it.size >= 2 && it[0] == "image" }?.get(1) } + remember(event) { event.tags?.firstOrNull { it.size >= 2 && it[0] == "image" }?.get(1) } val publishedAt = remember(event) { event.tags?.firstOrNull { it.size >= 2 && it[0] == "published_at" }?.get(1)?.toLongOrNull() } Surface( @@ -146,7 +146,7 @@ private fun ArticleCard( if (publishedAt != null) { Text( text = " \u00b7 ${ - _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Helpers.formatQuotedTimestamp( + Helpers.formatQuotedTimestamp( publishedAt ) }", diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/ContentParser.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/ContentParser.kt index afd02ea9..78c6545c 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/ContentParser.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/ContentParser.kt @@ -31,7 +31,7 @@ internal object ContentParser { val url = "https://$bareDomainCapture" val meta = imetaMap[url] val imetaMime = meta?.mime?.let { - _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Helpers.classifyByMime( + Helpers.classifyByMime( it ) } @@ -40,13 +40,13 @@ internal object ContentParser { imetaMime == "image" -> segments.add(ContentSegment.ImageSegment(meta!!)) imetaMime == "video" -> segments.add(ContentSegment.VideoSegment(meta!!)) imetaMime == "audio" -> segments.add(ContentSegment.AudioSegment(meta!!)) - ext in _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Constants.imageExtensions -> segments.add(ContentSegment.ImageSegment(meta ?: MediaMeta(url))) - ext in _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Constants.videoExtensions -> segments.add(ContentSegment.VideoSegment(meta ?: MediaMeta(url))) - ext in _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Constants.audioExtensions -> segments.add(ContentSegment.AudioSegment(meta ?: MediaMeta(url))) - _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Helpers.isBlossomUrl( + ext in Constants.imageExtensions -> segments.add(ContentSegment.ImageSegment(meta ?: MediaMeta(url))) + ext in Constants.videoExtensions -> segments.add(ContentSegment.VideoSegment(meta ?: MediaMeta(url))) + ext in Constants.audioExtensions -> segments.add(ContentSegment.AudioSegment(meta ?: MediaMeta(url))) + Helpers.isBlossomUrl( url ) -> segments.add(ContentSegment.UnknownMediaSegment(meta ?: MediaMeta(url))) - _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Helpers.isStandaloneUrl( + Helpers.isStandaloneUrl( content, match.range ) -> segments.add(ContentSegment.LinkSegment(url)) @@ -97,7 +97,7 @@ internal object ContentParser { val isWebSocket = url.startsWith("wss://") || url.startsWith("ws://") val meta = imetaMap[url] val imetaMime = meta?.mime?.let { - _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Helpers.classifyByMime( + Helpers.classifyByMime( it ) } @@ -106,9 +106,9 @@ internal object ContentParser { imetaMime == "image" -> segments.add(ContentSegment.ImageSegment(meta!!)) imetaMime == "video" -> segments.add(ContentSegment.VideoSegment(meta!!)) imetaMime == "audio" -> segments.add(ContentSegment.AudioSegment(meta!!)) - ext in _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Constants.imageExtensions -> segments.add(ContentSegment.ImageSegment(meta ?: MediaMeta(url))) - ext in _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Constants.videoExtensions -> segments.add(ContentSegment.VideoSegment(meta ?: MediaMeta(url))) - ext in _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Constants.audioExtensions -> segments.add(ContentSegment.AudioSegment(meta ?: MediaMeta(url))) + ext in Constants.imageExtensions -> segments.add(ContentSegment.ImageSegment(meta ?: MediaMeta(url))) + ext in Constants.videoExtensions -> segments.add(ContentSegment.VideoSegment(meta ?: MediaMeta(url))) + ext in Constants.audioExtensions -> segments.add(ContentSegment.AudioSegment(meta ?: MediaMeta(url))) // TODO: Support websockets // isWebSocket && '\'' in url -> { // val parsed = Nip29.parseGroupIdentifier(url) @@ -116,10 +116,10 @@ internal object ContentParser { // else segments.add(ContentSegment.InlineLinkSegment(url)) // } isWebSocket -> segments.add(ContentSegment.InlineLinkSegment(url)) - _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Helpers.isBlossomUrl( + Helpers.isBlossomUrl( url ) -> segments.add(ContentSegment.UnknownMediaSegment(meta ?: MediaMeta(url))) - _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Helpers.isStandaloneUrl( + Helpers.isStandaloneUrl( content, match.range ) -> segments.add(ContentSegment.LinkSegment(url)) @@ -141,7 +141,7 @@ internal object ContentParser { for (segment in segments) { if (segment is ContentSegment.TextSegment) { result.addAll( - _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Helpers.splitTextForEmojis( + Helpers.splitTextForEmojis( segment.text, emojiMap ) @@ -158,7 +158,7 @@ internal object ContentParser { for (segment in afterEmoji) { if (segment is ContentSegment.TextSegment) { finalResult.addAll( - _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Helpers.splitTextForInvoices( + Helpers.splitTextForInvoices( segment.text ) ) diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/FullScreenImageViewer.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/FullScreenImageViewer.kt index 88fb6285..cd29f5da 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/FullScreenImageViewer.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/FullScreenImageViewer.kt @@ -56,7 +56,7 @@ fun FullScreenImageViewer( } val clipboardManager = LocalClipboardManager.current - val scope = rememberCoroutineScope() + rememberCoroutineScope() Box( modifier = Modifier diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/Helpers.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/Helpers.kt index 394489f6..fc754980 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/Helpers.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/Helpers.kt @@ -16,7 +16,7 @@ internal object Helpers { return try { val uri = Url(url) val path = uri.fullPath ?: return false - _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Constants.blossomPathRegex.matches(path) + Constants.blossomPathRegex.matches(path) } catch (_: Exception) { false } @@ -33,23 +33,21 @@ internal object Helpers { val after = content.substring(matchRange.last + 1) val lineEnd = after.indexOf('\n') val suffix = if (lineEnd == -1) after else after.substring(0, lineEnd) - if (suffix.isNotBlank()) return false - - return true + return suffix.isBlank() } fun classifyByMime(mime: String): String? = when { - _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Constants.imageMimeTypes.any { mime.startsWith(it) } -> "image" - _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Constants.videoMimeTypes.any { mime.startsWith(it) } -> "video" - _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Constants.audioMimeTypes.any { mime.startsWith(it) } -> "audio" + Constants.imageMimeTypes.any { mime.startsWith(it) } -> "image" + Constants.videoMimeTypes.any { mime.startsWith(it) } -> "video" + Constants.audioMimeTypes.any { mime.startsWith(it) } -> "audio" else -> null } fun splitTextForEmojis(text: String, emojiMap: Map): List { val result = mutableListOf() var lastEnd = 0 - for (match in _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Constants.emojiShortcodeRegex.findAll(text)) { + for (match in Constants.emojiShortcodeRegex.findAll(text)) { val shortcode = match.groupValues[1] val url = emojiMap[shortcode] ?: continue if (match.range.first > lastEnd) { @@ -67,7 +65,7 @@ internal object Helpers { } fun splitTextForInvoices(text: String): List { - val matches = _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Constants.bolt11Regex.findAll(text).toList() + val matches = Constants.bolt11Regex.findAll(text).toList() if (matches.isEmpty()) return listOf(ContentSegment.TextSegment(text)) val result = mutableListOf() var lastEnd = 0 @@ -111,7 +109,7 @@ internal object Helpers { } suspend fun fetchOgData(url: String): OgData? = withContext(Dispatchers.IO) { - _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Constants.ogCache.get(url)?.let { return@withContext it } + Constants.ogCache.get(url)?.let { return@withContext it } null // TODO: YouTube blocks bot User-Agents; use their oEmbed API instead diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/ImageWithContextMenu.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/ImageWithContextMenu.kt index 007b4ff9..0df5a4b6 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/ImageWithContextMenu.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/ImageWithContextMenu.kt @@ -32,7 +32,7 @@ import androidx.compose.ui.platform.LocalClipboardManager import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.unit.dp -@kotlin.OptIn(ExperimentalFoundationApi::class) +@OptIn(ExperimentalFoundationApi::class) @Composable internal fun ImageWithContextMenu(meta: MediaMeta, onFullScreen: () -> Unit) { val url = meta.url diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/LinkPreview.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/LinkPreview.kt index be3d1786..f16530de 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/LinkPreview.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/LinkPreview.kt @@ -27,13 +27,13 @@ import io.ktor.http.Url @Composable internal fun LinkPreview(url: String) { - var ogData by remember(url) { mutableStateOf(_root_ide_package_.at.torch.compose.ui.composable.widgets.content.Constants.ogCache.get(url)) } + var ogData by remember(url) { mutableStateOf(Constants.ogCache.get(url)) } val uriHandler = LocalUriHandler.current LaunchedEffect(url) { if (ogData == null) { ogData = - _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Helpers.fetchOgData( + Helpers.fetchOgData( url ) } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/RichContent.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/RichContent.kt index 9b4ff7aa..3a6bbc46 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/RichContent.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/content/RichContent.kt @@ -170,7 +170,7 @@ fun RichContent( } is ContentSegment.CustomEmojiSegment -> { pushStringAnnotation( - tag = _root_ide_package_.at.torch.compose.ui.composable.widgets.content.Constants.INLINE_CONTENT_TAG, + tag = Constants.INLINE_CONTENT_TAG, annotation = seg.shortcode ) append(":${seg.shortcode}:") @@ -197,7 +197,7 @@ fun RichContent( onProfileClick?.invoke(pubkey) } ) { - withStyle(SpanStyle(color = _root_ide_package_.at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(seg.pubkey), textDecoration = linkDecoration)) { + withStyle(SpanStyle(color = at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(seg.pubkey), textDecoration = linkDecoration)) { append("@${displayName.trimEnd()}") } } @@ -244,8 +244,7 @@ fun RichContent( Text(text = annotated, style = style, inlineContent = emojiInlineContent) } else { - val segment = group as ContentSegment - when (segment) { + when (val segment = group as ContentSegment) { is ContentSegment.ImageSegment -> { ImageWithContextMenu( meta = segment.meta, diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/detail/MetadataEventDetail.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/detail/MetadataEventDetail.kt index bd670147..d6ed1aca 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/detail/MetadataEventDetail.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/detail/MetadataEventDetail.kt @@ -63,11 +63,11 @@ fun MetadataEventDetail( val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior(rememberTopAppBarState()) val metadataEventDetailViewModel: at.torch.compose.ui.view.model.MetadataEventDetailViewModel = viewModel( - factory = _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailViewModel.Companion.factory( + factory = at.torch.compose.ui.view.model.MetadataEventDetailViewModel.factory( activeUserPublicKey = activeUserPublicKey, publicKey = localNostrEvent.nostrEvent.pubKey, nostrRepository = nostrRepository, - pagerState = rememberPagerState { _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailType.entries.size } + pagerState = rememberPagerState { at.torch.compose.ui.view.model.MetadataEventDetailType.entries.size } ), ) @@ -150,7 +150,7 @@ fun MetadataEventDetail( ) when(val metadataEventDetailUIState = metadataEventDetailViewModel.metadataEventDetailUIState) { - _root_ide_package_.at.torch.compose.ui.view.state.MetadataEventDetailUIState.Error -> { + at.torch.compose.ui.view.state.MetadataEventDetailUIState.Error -> { Icon( Icons.Default.Error, contentDescription = "Something went wrong" @@ -203,7 +203,7 @@ fun MetadataEventDetail( } - _root_ide_package_.at.torch.compose.ui.view.state.MetadataEventDetailUIState.Loading -> { + at.torch.compose.ui.view.state.MetadataEventDetailUIState.Loading -> { LoadingIndicator() } } @@ -246,7 +246,7 @@ fun MetadataEventDetail( edgePadding = 10.dp, selectedTabIndex = metadataEventDetailViewModel.pagerState.currentPage, ) { - _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailType.entries.forEachIndexed { index, destination -> + at.torch.compose.ui.view.model.MetadataEventDetailType.entries.forEachIndexed { index, destination -> Tab( selected = metadataEventDetailViewModel.pagerState.currentPage == index, onClick = { @@ -273,17 +273,17 @@ fun MetadataEventDetail( HorizontalPager( state = metadataEventDetailViewModel.pagerState, ) { pageIndex -> - val metadataEventDetailType = _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailType.entries[pageIndex] + val metadataEventDetailType = at.torch.compose.ui.view.model.MetadataEventDetailType.entries[pageIndex] when (metadataEventDetailType) { - _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailType.Posts, _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailType.Replies, - _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailType.Articles, _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailType.Zaps, - _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailType.Photos, _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailType.Shorts, _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailType.Videos, - _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailType.Bookmarks, _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailType.Reports, _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailType.Relays -> { + at.torch.compose.ui.view.model.MetadataEventDetailType.Posts, at.torch.compose.ui.view.model.MetadataEventDetailType.Replies, + at.torch.compose.ui.view.model.MetadataEventDetailType.Articles, at.torch.compose.ui.view.model.MetadataEventDetailType.Zaps, + at.torch.compose.ui.view.model.MetadataEventDetailType.Photos, at.torch.compose.ui.view.model.MetadataEventDetailType.Shorts, at.torch.compose.ui.view.model.MetadataEventDetailType.Videos, + at.torch.compose.ui.view.model.MetadataEventDetailType.Bookmarks, at.torch.compose.ui.view.model.MetadataEventDetailType.Reports, at.torch.compose.ui.view.model.MetadataEventDetailType.Relays -> { val feedListViewModel: at.torch.compose.ui.view.model.FeedListViewModel = viewModel( key = metadataEventDetailType.name, - factory = _root_ide_package_.at.torch.compose.ui.view.model.FeedListViewModel.Companion.factory( - initialFeedListUIState = _root_ide_package_.at.torch.compose.ui.view.state.FeedListUIState.Loading, + factory = at.torch.compose.ui.view.model.FeedListViewModel.factory( + initialFeedListUIState = at.torch.compose.ui.view.state.FeedListUIState.Loading, synchronizationFilter = metadataEventDetailViewModel.getSynchronizationFilter(metadataEventDetailType), nostrRepository = nostrRepository ), @@ -301,11 +301,11 @@ fun MetadataEventDetail( } } // TODO: Support gallery feeds... - _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailType.Following -> { + at.torch.compose.ui.view.model.MetadataEventDetailType.Following -> { val followingListViewModel: at.torch.compose.ui.view.model.FollowingListViewModel = viewModel( key = metadataEventDetailType.name, - factory = _root_ide_package_.at.torch.compose.ui.view.model.FollowingListViewModel.Companion.factory( - initialFeedListUIState = _root_ide_package_.at.torch.compose.ui.view.state.FollowingListUIState.Loading, + factory = at.torch.compose.ui.view.model.FollowingListViewModel.factory( + initialFeedListUIState = at.torch.compose.ui.view.state.FollowingListUIState.Loading, publicKey = localNostrEvent.nostrEvent.pubKey, synchronizationFilter = metadataEventDetailViewModel.getSynchronizationFilter(metadataEventDetailType), nostrRepository = nostrRepository @@ -324,11 +324,11 @@ fun MetadataEventDetail( followingListViewModel.initiate() } } - _root_ide_package_.at.torch.compose.ui.view.model.MetadataEventDetailType.Followers -> { + at.torch.compose.ui.view.model.MetadataEventDetailType.Followers -> { val followersListViewModel: at.torch.compose.ui.view.model.FollowersListViewModel = viewModel( key = metadataEventDetailType.name, - factory = _root_ide_package_.at.torch.compose.ui.view.model.FollowersListViewModel.Companion.factory( - initialFeedListUIState = _root_ide_package_.at.torch.compose.ui.view.state.FollowersListUIState.Loading, + factory = at.torch.compose.ui.view.model.FollowersListViewModel.factory( + initialFeedListUIState = at.torch.compose.ui.view.state.FollowersListUIState.Loading, publicKey = localNostrEvent.nostrEvent.pubKey, synchronizationFilter = metadataEventDetailViewModel.getSynchronizationFilter(metadataEventDetailType), nostrRepository = nostrRepository @@ -391,7 +391,7 @@ private fun MetadataEventEventDetailPreview() { onNavigateToEvent = {}, onNavigateToEditProfile = {}, onNavigateToChatRoom = {}, - nostrRepository = _root_ide_package_.at.torch.compose.repository.NostrRepository.Companion.NO_OP_NOSTR_REPOSITORY + nostrRepository = at.torch.compose.repository.NostrRepository.NO_OP_NOSTR_REPOSITORY ) } } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/detail/TextNoteEventDetail.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/detail/TextNoteEventDetail.kt index aaafa792..39a5bcb5 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/detail/TextNoteEventDetail.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/detail/TextNoteEventDetail.kt @@ -61,10 +61,10 @@ fun TextNoteEventDetail( val inReplyToNostrEventFeedListViewModel: at.torch.compose.ui.view.model.InReplyToViewModel = viewModel( key = "replies-${localNostrEvent.nostrEvent.id}", - factory = _root_ide_package_.at.torch.compose.ui.view.model.InReplyToViewModel.Companion.factory( + factory = at.torch.compose.ui.view.model.InReplyToViewModel.factory( nostrEvent = localNostrEvent.nostrEvent, profile = localNostrEvent.profile, - initialFeedListUIState = _root_ide_package_.at.torch.compose.ui.view.state.FeedListUIState.Loading, + initialFeedListUIState = at.torch.compose.ui.view.state.FeedListUIState.Loading, nostrRepository = nostrRepository, createdAt = localNostrEvent.nostrEvent.createdAt ), @@ -118,7 +118,7 @@ fun TextNoteEventDetail( Icon( Icons.Default.Person, contentDescription = "User profile", - tint = _root_ide_package_.at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey("profile") + tint = at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey("profile") ) // ProfileAvatar( // profile = localProfile.profile, @@ -219,7 +219,7 @@ fun TextNoteEventDetail( Text( text = staticIdentifier, style = MaterialTheme.typography.labelMedium, - color = _root_ide_package_.at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromProfile( + color = at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromProfile( profile ) ) @@ -354,14 +354,14 @@ fun TextNoteEventDetail( } } } - _root_ide_package_.at.torch.compose.ui.view.state.FeedListUIState.Error -> { + at.torch.compose.ui.view.state.FeedListUIState.Error -> { item { Text( text = "Something went wrong" ) } } - _root_ide_package_.at.torch.compose.ui.view.state.FeedListUIState.Loading -> { + at.torch.compose.ui.view.state.FeedListUIState.Loading -> { item { LoadingIndicator() } @@ -408,7 +408,7 @@ It has survived not only five centuries, but also the leap into electronic types onNavigateBack = {}, onNavigateToWriteAReply = {}, onNavigateToNostrEvent = {}, - nostrRepository = _root_ide_package_.at.torch.compose.repository.NostrRepository.Companion.NO_OP_NOSTR_REPOSITORY + nostrRepository = at.torch.compose.repository.NostrRepository.NO_OP_NOSTR_REPOSITORY ) } } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/feed/EventListView.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/feed/EventListView.kt index e3258e58..7dff75de 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/feed/EventListView.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/feed/EventListView.kt @@ -60,7 +60,7 @@ fun at.torch.compose.database.model.intermdiate.LocalNostrEvent.ListView( Text( text = profile?.humanReadableNameOrPubkey() ?: nostrEvent.pubKey, style = MaterialTheme.typography.labelSmall, - color = _root_ide_package_.at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(profile?.publicKey ?: nostrEvent.pubKey) + color = at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(profile?.publicKey ?: nostrEvent.pubKey) ) Text( text = "reposted", diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/feed/TextNoteFeedItem.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/feed/TextNoteFeedItem.kt index 41e1f518..e8bf10d6 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/feed/TextNoteFeedItem.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/composable/widgets/feed/TextNoteFeedItem.kt @@ -59,7 +59,7 @@ internal fun TextNoteFeedItem( } ), style = MaterialTheme.typography.labelLargeEmphasized, - color = _root_ide_package_.at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(localInReplyToNostrEvent.nostrEvent.pubKey), + color = at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(localInReplyToNostrEvent.nostrEvent.pubKey), text = localInReplyToNostrEvent.profile?.humanReadableNameOrPubkey() ?: "loading information..." ) } @@ -105,7 +105,7 @@ internal fun TextNoteFeedItem( Text( text = staticIdentifier, style = MaterialTheme.typography.bodySmall, - color = _root_ide_package_.at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromProfile(profile) + color = at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromProfile(profile) ) } } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/ChatRoomDetailMessageListViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/ChatRoomDetailMessageListViewModel.kt index c230a668..b47a36a9 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/ChatRoomDetailMessageListViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/ChatRoomDetailMessageListViewModel.kt @@ -76,7 +76,7 @@ class ChatRoomDetailMessageListViewModel( localChatRoom.chatRoom.id ).distinctUntilChanged().collect { chatMessages -> logger.d("getChatMessageListByChatRoomId: $chatMessages") - chatRoomDetailMessageListUIState = _root_ide_package_.at.torch.compose.ui.view.state.ChatRoomDetailMessageListUIState.Loaded( + chatRoomDetailMessageListUIState = at.torch.compose.ui.view.state.ChatRoomDetailMessageListUIState.Loaded( chatMessageList = chatMessages ) } @@ -112,7 +112,7 @@ class ChatRoomDetailMessageListViewModel( isReceiverChatMessageRelayListMissing.value = true // TODO: compute the timestamp for when list we sent messages and use that as since... Pair( - _root_ide_package_.at.torch.compose.nostr.Relays.negentropicRelaySet, + at.torch.compose.nostr.Relays.negentropicRelaySet, _root_ide_package_.at.torch.compose.database.model.types.SynchronizationFilter( kinds = arrayOf( ChatMessageRelayListEvent.KIND, @@ -129,7 +129,7 @@ class ChatRoomDetailMessageListViewModel( val negentropySynchronizeRequests = relayAndSynchronizationFilter.first.map { normalizedRelayUrl -> _root_ide_package_.at.torch.compose.database.model.NegentropySynchronizeRequest( - id = _root_ide_package_.at.torch.compose.database.model.NegentropySynchronizeRequest.Companion.computeId( + id = at.torch.compose.database.model.NegentropySynchronizeRequest.computeId( relayURL = normalizedRelayUrl.url, synchronizationFilter = relayAndSynchronizationFilter.second ), @@ -161,7 +161,7 @@ class ChatRoomDetailMessageListViewModel( horizontalAlignment = Alignment.CenterHorizontally ) { when (val chatRoomDetailMessageListUIState = this@ChatRoomDetailMessageListViewModel.chatRoomDetailMessageListUIState) { - _root_ide_package_.at.torch.compose.ui.view.state.ChatRoomDetailMessageListUIState.Error -> { + at.torch.compose.ui.view.state.ChatRoomDetailMessageListUIState.Error -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -286,7 +286,7 @@ class ChatRoomDetailMessageListViewModel( text = localChatMessage.profile?.humanReadableNameOrPubkey() ?: localChatMessage.chatMessage.senderPublicKey, maxLines = 1, overflow = TextOverflow.MiddleEllipsis, - color = _root_ide_package_.at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(localChatMessage.chatMessage.senderPublicKey), + color = at.torch.compose.ui.composable.widgets.profile.ProfileColor.fromPublicKey(localChatMessage.chatMessage.senderPublicKey), style = MaterialTheme.typography.labelSmall ) } @@ -342,7 +342,7 @@ class ChatRoomDetailMessageListViewModel( } } } - _root_ide_package_.at.torch.compose.ui.view.state.ChatRoomDetailMessageListUIState.Loading -> { + at.torch.compose.ui.view.state.ChatRoomDetailMessageListUIState.Loading -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -384,7 +384,7 @@ class ChatRoomDetailMessageListViewModel( const val TAG = "ChatRoomDetailMessageListViewModel" fun factory( - initialChatRoomDetailMessageListUIState: at.torch.compose.ui.view.state.ChatRoomDetailMessageListUIState = _root_ide_package_.at.torch.compose.ui.view.state.ChatRoomDetailMessageListUIState.Loading, + initialChatRoomDetailMessageListUIState: at.torch.compose.ui.view.state.ChatRoomDetailMessageListUIState = at.torch.compose.ui.view.state.ChatRoomDetailMessageListUIState.Loading, localChatRoom: at.torch.compose.database.model.intermdiate.LocalChatRoom, nostrRepository: at.torch.compose.repository.NostrRepository, chatRepository: at.torch.compose.repository.ChatRepository diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/ChatRoomListViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/ChatRoomListViewModel.kt index 72b7afc6..9722cfd2 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/ChatRoomListViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/ChatRoomListViewModel.kt @@ -54,7 +54,7 @@ class ChatRoomListViewModel( publicKey ).collect { chatRooms -> logger.d("ChatRoomList: $chatRooms") - chatRoomListUIState = _root_ide_package_.at.torch.compose.ui.view.state.ChatRoomListUIState.Loaded( + chatRoomListUIState = at.torch.compose.ui.view.state.ChatRoomListUIState.Loaded( chatRoomList = chatRooms ) } @@ -66,9 +66,9 @@ class ChatRoomListViewModel( viewModelScope.launch(Dispatchers.IO) { // Sync Notifications... might want to also run this in the background nostrRepository.queueNegentropySynchronizeRequest( - _root_ide_package_.at.torch.compose.nostr.Relays.DefaultDMRelayList.shuffled().map { normalizedRelayUrl -> + at.torch.compose.nostr.Relays.DefaultDMRelayList.shuffled().map { normalizedRelayUrl -> _root_ide_package_.at.torch.compose.database.model.NegentropySynchronizeRequest( - id = _root_ide_package_.at.torch.compose.database.model.NegentropySynchronizeRequest.Companion.computeId( + id = at.torch.compose.database.model.NegentropySynchronizeRequest.computeId( relayURL = normalizedRelayUrl.url, synchronizationFilter = synchronizationFilter ), @@ -92,7 +92,7 @@ class ChatRoomListViewModel( horizontalAlignment = Alignment.CenterHorizontally ) { when (val chatRoomListUIState = chatRoomListUIState) { - _root_ide_package_.at.torch.compose.ui.view.state.ChatRoomListUIState.Error -> { + at.torch.compose.ui.view.state.ChatRoomListUIState.Error -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -149,7 +149,7 @@ class ChatRoomListViewModel( } } } - _root_ide_package_.at.torch.compose.ui.view.state.ChatRoomListUIState.Loading -> { + at.torch.compose.ui.view.state.ChatRoomListUIState.Loading -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -176,7 +176,7 @@ class ChatRoomListViewModel( const val TAG = "ChatRoomListViewModel" fun factory( - initialChatRoomListUIState: at.torch.compose.ui.view.state.ChatRoomListUIState = _root_ide_package_.at.torch.compose.ui.view.state.ChatRoomListUIState.Loading, + initialChatRoomListUIState: at.torch.compose.ui.view.state.ChatRoomListUIState = at.torch.compose.ui.view.state.ChatRoomListUIState.Loading, publicKey: String, synchronizationFilter: at.torch.compose.database.model.types.SynchronizationFilter, nostrRepository: at.torch.compose.repository.NostrRepository, diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/CreateProfileViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/CreateProfileViewModel.kt index 8f0d9132..41a1965c 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/CreateProfileViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/CreateProfileViewModel.kt @@ -77,7 +77,7 @@ class CreateProfileViewModel( } - public fun createAccount( + fun createAccount( writeSeed: (List) -> Unit // onNavigateToUnsignedProfile: (UnsignedProfileRoute) -> Unit, // onNavigateToUnannouncedProfile: (UnannouncedProfileRoute) -> Unit diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/FeedListViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/FeedListViewModel.kt index 8c899f25..b0f5a542 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/FeedListViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/FeedListViewModel.kt @@ -43,9 +43,9 @@ class FeedListViewModel( val isSynchronizationPending: MutableState = mutableStateOf(false) - val negentropySynchronizeRequests = _root_ide_package_.at.torch.compose.nostr.Relays.negentropicRelaySet.shuffled().map { normalizedRelayUrl -> + val negentropySynchronizeRequests = at.torch.compose.nostr.Relays.negentropicRelaySet.shuffled().map { normalizedRelayUrl -> _root_ide_package_.at.torch.compose.database.model.NegentropySynchronizeRequest( - id = _root_ide_package_.at.torch.compose.database.model.NegentropySynchronizeRequest.Companion.computeId( + id = at.torch.compose.database.model.NegentropySynchronizeRequest.computeId( normalizedRelayUrl.url, synchronizationFilter = synchronizationFilter ), @@ -70,7 +70,7 @@ class FeedListViewModel( nostrRepository.observeNostrFeed( synchronizationFilter ).distinctUntilChanged().first().let { localNostrEvents -> - feedListUIState = _root_ide_package_.at.torch.compose.ui.view.state.FeedListUIState.Loaded( + feedListUIState = at.torch.compose.ui.view.state.FeedListUIState.Loaded( localNostrEvents = localNostrEvents ) } @@ -108,7 +108,7 @@ class FeedListViewModel( horizontalAlignment = Alignment.CenterHorizontally ) { when (val feedListUIState = feedListUIState) { - _root_ide_package_.at.torch.compose.ui.view.state.FeedListUIState.Error -> { + at.torch.compose.ui.view.state.FeedListUIState.Error -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -159,7 +159,7 @@ class FeedListViewModel( } } - _root_ide_package_.at.torch.compose.ui.view.state.FeedListUIState.Loading -> { + at.torch.compose.ui.view.state.FeedListUIState.Loading -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -186,7 +186,7 @@ class FeedListViewModel( const val TAG = "FeedListViewModel" fun factory( - initialFeedListUIState: at.torch.compose.ui.view.state.FeedListUIState = _root_ide_package_.at.torch.compose.ui.view.state.FeedListUIState.Loading, + initialFeedListUIState: at.torch.compose.ui.view.state.FeedListUIState = at.torch.compose.ui.view.state.FeedListUIState.Loading, synchronizationFilter: at.torch.compose.database.model.types.SynchronizationFilter, nostrRepository: at.torch.compose.repository.NostrRepository, ): ViewModelProvider.Factory = viewModelFactory { diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/FollowersListViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/FollowersListViewModel.kt index e7eefef8..50d7fb87 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/FollowersListViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/FollowersListViewModel.kt @@ -55,7 +55,7 @@ class FollowersListViewModel( nostrRepository.observeProfileWithFollowers( publicKey ).collect { localFollowers -> - followersListUIState = _root_ide_package_.at.torch.compose.ui.view.state.FollowersListUIState.Loaded( + followersListUIState = at.torch.compose.ui.view.state.FollowersListUIState.Loaded( followers = localFollowers?.followers ?: emptyList() ) } @@ -67,9 +67,9 @@ class FollowersListViewModel( viewModelScope.launch(Dispatchers.IO) { // Sync Notifications... might want to also run this in the background nostrRepository.queueNegentropySynchronizeRequest( - _root_ide_package_.at.torch.compose.nostr.Relays.negentropicRelaySet.shuffled().map { normalizedRelayUrl -> + at.torch.compose.nostr.Relays.negentropicRelaySet.shuffled().map { normalizedRelayUrl -> _root_ide_package_.at.torch.compose.database.model.NegentropySynchronizeRequest( - id = _root_ide_package_.at.torch.compose.database.model.NegentropySynchronizeRequest.Companion.computeId( + id = at.torch.compose.database.model.NegentropySynchronizeRequest.computeId( relayURL = normalizedRelayUrl.url, synchronizationFilter = synchronizationFilter ), @@ -104,7 +104,7 @@ class FollowersListViewModel( horizontalAlignment = Alignment.CenterHorizontally ) { when (val followersListUIState = followersListUIState) { - _root_ide_package_.at.torch.compose.ui.view.state.FollowersListUIState.Error -> { + at.torch.compose.ui.view.state.FollowersListUIState.Error -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -149,7 +149,7 @@ class FollowersListViewModel( } } - _root_ide_package_.at.torch.compose.ui.view.state.FollowersListUIState.Loading -> { + at.torch.compose.ui.view.state.FollowersListUIState.Loading -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -176,7 +176,7 @@ class FollowersListViewModel( const val TAG = "FollowersListViewModel" fun factory( - initialFeedListUIState: at.torch.compose.ui.view.state.FollowersListUIState = _root_ide_package_.at.torch.compose.ui.view.state.FollowersListUIState.Loading, + initialFeedListUIState: at.torch.compose.ui.view.state.FollowersListUIState = at.torch.compose.ui.view.state.FollowersListUIState.Loading, publicKey: String, synchronizationFilter: at.torch.compose.database.model.types.SynchronizationFilter, nostrRepository: at.torch.compose.repository.NostrRepository, diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/FollowingListViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/FollowingListViewModel.kt index ce14ffab..e3b41dd2 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/FollowingListViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/FollowingListViewModel.kt @@ -54,7 +54,7 @@ class FollowingListViewModel( nostrRepository.observeProfileWithFollowing( publicKey ).collect { localFollowing -> - followingListUIState = _root_ide_package_.at.torch.compose.ui.view.state.FollowingListUIState.Loaded( + followingListUIState = at.torch.compose.ui.view.state.FollowingListUIState.Loaded( following = localFollowing?.following ?: emptyList() ) } @@ -66,9 +66,9 @@ class FollowingListViewModel( viewModelScope.launch(Dispatchers.IO) { // Sync Notifications... might want to also run this in the background nostrRepository.queueNegentropySynchronizeRequest( - _root_ide_package_.at.torch.compose.nostr.Relays.negentropicRelaySet.shuffled().map { normalizedRelayUrl -> + at.torch.compose.nostr.Relays.negentropicRelaySet.shuffled().map { normalizedRelayUrl -> _root_ide_package_.at.torch.compose.database.model.NegentropySynchronizeRequest( - id = _root_ide_package_.at.torch.compose.database.model.NegentropySynchronizeRequest.Companion.computeId( + id = at.torch.compose.database.model.NegentropySynchronizeRequest.computeId( relayURL = normalizedRelayUrl.url, synchronizationFilter = synchronizationFilter ), @@ -103,7 +103,7 @@ class FollowingListViewModel( horizontalAlignment = Alignment.CenterHorizontally ) { when (val feedListUIState = followingListUIState) { - _root_ide_package_.at.torch.compose.ui.view.state.FollowingListUIState.Error -> { + at.torch.compose.ui.view.state.FollowingListUIState.Error -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -148,7 +148,7 @@ class FollowingListViewModel( } } - _root_ide_package_.at.torch.compose.ui.view.state.FollowingListUIState.Loading -> { + at.torch.compose.ui.view.state.FollowingListUIState.Loading -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -175,7 +175,7 @@ class FollowingListViewModel( const val TAG = "FollowingListViewModel" fun factory( - initialFeedListUIState: at.torch.compose.ui.view.state.FollowingListUIState = _root_ide_package_.at.torch.compose.ui.view.state.FollowingListUIState.Loading, + initialFeedListUIState: at.torch.compose.ui.view.state.FollowingListUIState = at.torch.compose.ui.view.state.FollowingListUIState.Loading, publicKey: String, synchronizationFilter: at.torch.compose.database.model.types.SynchronizationFilter, nostrRepository: at.torch.compose.repository.NostrRepository, diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/HomeViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/HomeViewModel.kt index da2d3a46..ae5247f7 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/HomeViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/HomeViewModel.kt @@ -46,11 +46,11 @@ class HomeViewModel( activeUserPublicKey ).collect { profileWithFollowing -> homeScreenUIState = if (profileWithFollowing != null) { - _root_ide_package_.at.torch.compose.ui.view.state.HomeScreenUIState.Loaded( + at.torch.compose.ui.view.state.HomeScreenUIState.Loaded( profileWithFollowing = profileWithFollowing ) } else { - _root_ide_package_.at.torch.compose.ui.view.state.HomeScreenUIState.Error + at.torch.compose.ui.view.state.HomeScreenUIState.Error } } } @@ -61,8 +61,8 @@ class HomeViewModel( profileWithFollowing: at.torch.compose.database.model.intermdiate.LocalProfileWithFollowing, ): at.torch.compose.database.model.types.SynchronizationFilter { - val twelveHoursAgo = Clock.System.now().minus(12.hours) - val now = Clock.System.now() + Clock.System.now().minus(12.hours) + Clock.System.now() return when (homeScreenType) { HomeScreenType.Messages -> { diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/InReplyToViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/InReplyToViewModel.kt index 18027ddf..b1831e83 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/InReplyToViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/InReplyToViewModel.kt @@ -61,7 +61,7 @@ class InReplyToViewModel( nostrRepository.observeNostrFeed( synchronizationFilter ).distinctUntilChanged().collect { localNostrEvents -> - inReplyToFeedListUIState = _root_ide_package_.at.torch.compose.ui.view.state.FeedListUIState.Loaded( + inReplyToFeedListUIState = at.torch.compose.ui.view.state.FeedListUIState.Loaded( localNostrEvents = localNostrEvents ) } @@ -74,12 +74,12 @@ class InReplyToViewModel( // Sync Notifications... might want to also run this in the background val publicRelays = profile?.profilePublicRelays( nostrRepository - ) ?: _root_ide_package_.at.torch.compose.nostr.Relays.negentropicRelaySet + ) ?: at.torch.compose.nostr.Relays.negentropicRelaySet nostrRepository.queueNegentropySynchronizeRequest( publicRelays.take(3).map { normalizedRelayUrl -> _root_ide_package_.at.torch.compose.database.model.NegentropySynchronizeRequest( - id = _root_ide_package_.at.torch.compose.database.model.NegentropySynchronizeRequest.Companion.computeId( + id = at.torch.compose.database.model.NegentropySynchronizeRequest.computeId( relayURL = normalizedRelayUrl.url, synchronizationFilter = synchronizationFilter ), @@ -114,7 +114,7 @@ class InReplyToViewModel( horizontalAlignment = Alignment.CenterHorizontally ) { when (val feedListUIState = inReplyToFeedListUIState) { - _root_ide_package_.at.torch.compose.ui.view.state.FeedListUIState.Error -> { + at.torch.compose.ui.view.state.FeedListUIState.Error -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -165,7 +165,7 @@ class InReplyToViewModel( } } - _root_ide_package_.at.torch.compose.ui.view.state.FeedListUIState.Loading -> { + at.torch.compose.ui.view.state.FeedListUIState.Loading -> { Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally @@ -195,7 +195,7 @@ class InReplyToViewModel( nostrEvent: at.torch.compose.database.model.NostrEvent, profile: at.torch.compose.database.model.Profile?, createdAt: Instant, - initialFeedListUIState: at.torch.compose.ui.view.state.FeedListUIState = _root_ide_package_.at.torch.compose.ui.view.state.FeedListUIState.Loading, + initialFeedListUIState: at.torch.compose.ui.view.state.FeedListUIState = at.torch.compose.ui.view.state.FeedListUIState.Loading, synchronizationFilter: at.torch.compose.database.model.types.SynchronizationFilter = _root_ide_package_.at.torch.compose.database.model.types.SynchronizationFilter( kinds = arrayOf( TextNoteEvent.KIND, diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/MetadataEventDetailViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/MetadataEventDetailViewModel.kt index bd2c5721..202727c6 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/MetadataEventDetailViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/MetadataEventDetailViewModel.kt @@ -38,7 +38,7 @@ enum class MetadataEventDetailType { } class MetadataEventDetailViewModel( - initialMetadataEventDetailUIState: at.torch.compose.ui.view.state.MetadataEventDetailUIState = _root_ide_package_.at.torch.compose.ui.view.state.MetadataEventDetailUIState.Loading, + initialMetadataEventDetailUIState: at.torch.compose.ui.view.state.MetadataEventDetailUIState = at.torch.compose.ui.view.state.MetadataEventDetailUIState.Loading, val activeUserPublicKey: HexKey, val eventPublicKey: HexKey, val nostrRepository: at.torch.compose.repository.NostrRepository, @@ -66,7 +66,7 @@ class MetadataEventDetailViewModel( ).collect { relations -> logger.d("We found relations: $relations") - metadataEventDetailUIState = _root_ide_package_.at.torch.compose.ui.view.state.MetadataEventDetailUIState.Loaded( + metadataEventDetailUIState = at.torch.compose.ui.view.state.MetadataEventDetailUIState.Loaded( isActiveUser = isActiveUser(activeUserPublicKey), followingActiveUserConnection = relations.find { connection -> connection.sourcePublicKey == eventPublicKey && connection.destinationPublicKey == activeUserPublicKey }, followedByActiveUserConnection = relations.find { connection -> connection.sourcePublicKey == activeUserPublicKey && connection.destinationPublicKey == eventPublicKey } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/NavigationViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/NavigationViewModel.kt index 3a173ee2..7574cb86 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/NavigationViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/NavigationViewModel.kt @@ -66,19 +66,19 @@ class NavigationViewModel( logger.d("Active Wallet: $activeWallet") if (activeWallet == null) { _navigationUIState.getAndUpdate { - _root_ide_package_.at.torch.compose.ui.view.state.NavigationUIState.StartupPhoenix + at.torch.compose.ui.view.state.NavigationUIState.StartupPhoenix } } else { if (activeWallet.business == null) { _navigationUIState.getAndUpdate { - _root_ide_package_.at.torch.compose.ui.view.state.NavigationUIState.StartupPhoenix + at.torch.compose.ui.view.state.NavigationUIState.StartupPhoenix } } else { val activeUserPublicKey = activeWallet.business.walletManager.keyManager.value?.nostrPublicKey() if (activeUserPublicKey == null) { _navigationUIState.getAndUpdate { - _root_ide_package_.at.torch.compose.ui.view.state.NavigationUIState.Loading(text = "Couldn't get the nostrKey") + at.torch.compose.ui.view.state.NavigationUIState.Loading(text = "Couldn't get the nostrKey") } } else { @@ -91,48 +91,48 @@ class NavigationViewModel( _navigationUIState.getAndUpdate { if (localProfile == null) { logger.i("We need to be on the landing screen so user creates account") - _root_ide_package_.at.torch.compose.ui.view.state.NavigationUIState.Landing + at.torch.compose.ui.view.state.NavigationUIState.Landing } else if (localProfile.unsignedNostrEvent == null) { logger.i("We need to be on the landing screen so user creates account") - _root_ide_package_.at.torch.compose.ui.view.state.NavigationUIState.Landing + at.torch.compose.ui.view.state.NavigationUIState.Landing } else if (localProfile.broadcastNostrEventReceipt != null) { logger.i("We have a broadcast receipt: ${localProfile.profile}") - _root_ide_package_.at.torch.compose.ui.view.state.NavigationUIState.ProfileLoaded( + at.torch.compose.ui.view.state.NavigationUIState.ProfileLoaded( publicKey = localProfile.unsignedNostrEvent.pubKey ) } else if (localProfile.unsignedNostrEvent.signedAt != null && localProfile.profile != null) { logger.i("We have successfully synced a profile: ${localProfile.profile}") - _root_ide_package_.at.torch.compose.ui.view.state.NavigationUIState.ProfileLoaded( + at.torch.compose.ui.view.state.NavigationUIState.ProfileLoaded( publicKey = localProfile.unsignedNostrEvent.pubKey ) } else if (localProfile.broadcastNostrEventRequest != null) { logger.i("We have a broadcast request: ${localProfile.broadcastNostrEventRequest}") - _root_ide_package_.at.torch.compose.ui.view.state.NavigationUIState.UnannouncedProfile( + at.torch.compose.ui.view.state.NavigationUIState.UnannouncedProfile( broadcastNostrEventRequest = localProfile.broadcastNostrEventRequest ) } else if (localProfile.profile != null) { logger.i("We have a profile that needs to queued for broadcast: ${localProfile.profile}") - _root_ide_package_.at.torch.compose.ui.view.state.NavigationUIState.UnqueuedProfile( + at.torch.compose.ui.view.state.NavigationUIState.UnqueuedProfile( profile = localProfile.profile ) } else if (localProfile.nostrEvent != null) { logger.i("Nostr event with the profile needs to be indexed: ${localProfile.nostrEvent}") - _root_ide_package_.at.torch.compose.ui.view.state.NavigationUIState.UnindexedProfile( + at.torch.compose.ui.view.state.NavigationUIState.UnindexedProfile( nostrEvent = localProfile.nostrEvent ) } else if (localProfile.unsignedNostrEvent.signedAt != null && localProfile.synchronizeNostrEventRequests.isEmpty()) { logger.i("We should request to sync profile: ${localProfile.unsignedNostrEvent}") - _root_ide_package_.at.torch.compose.ui.view.state.NavigationUIState.UnqueuedProfileSynchronization( + at.torch.compose.ui.view.state.NavigationUIState.UnqueuedProfileSynchronization( unsignedNostrEvent = localProfile.unsignedNostrEvent ) } else if (localProfile.unsignedNostrEvent.signedAt != null && localProfile.synchronizeNostrEventRequests.isEmpty()) { logger.i("We should be syncing the profile: ${localProfile.unsignedNostrEvent}") - _root_ide_package_.at.torch.compose.ui.view.state.NavigationUIState.UnsyncedProfile( + at.torch.compose.ui.view.state.NavigationUIState.UnsyncedProfile( unsignedNostrEvent = localProfile.unsignedNostrEvent ) } else { logger.i("We have an unsigned profile: ${localProfile.unsignedNostrEvent}") - _root_ide_package_.at.torch.compose.ui.view.state.NavigationUIState.UnsignedProfile( + at.torch.compose.ui.view.state.NavigationUIState.UnsignedProfile( unsignedNostrEvent = localProfile.unsignedNostrEvent ) } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/NostrEventDetailViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/NostrEventDetailViewModel.kt index fa6bc779..00ad87e4 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/NostrEventDetailViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/NostrEventDetailViewModel.kt @@ -28,7 +28,7 @@ class NostrEventDetailViewModel( private set fun retryLoad() { - nostrEventDetailUIState = _root_ide_package_.at.torch.compose.ui.view.state.NostrEventDetailUIState.Loading + nostrEventDetailUIState = at.torch.compose.ui.view.state.NostrEventDetailUIState.Loading loadNostrFeed() } @@ -36,7 +36,7 @@ class NostrEventDetailViewModel( viewModelScope.launch(Dispatchers.IO) { // Sync Notifications... might want to also run this in the background nostrRepository.queueSynchronizeNostrEvent( - _root_ide_package_.at.torch.compose.nostr.Relays.eventPublishRelaySet.take(1).map { normalizedRelay -> // TODO: Sync from all relays instead of 1 + at.torch.compose.nostr.Relays.eventPublishRelaySet.take(1).map { normalizedRelay -> // TODO: Sync from all relays instead of 1 _root_ide_package_.at.torch.compose.database.model.SynchronizeNostrEventRequest( purpose = "detail", synchronizationFilters = arrayOf( @@ -69,11 +69,11 @@ class NostrEventDetailViewModel( nostrEventId ).collectLatest { localNostrEvent -> nostrEventDetailUIState = if (localNostrEvent != null) { - _root_ide_package_.at.torch.compose.ui.view.state.NostrEventDetailUIState.Loaded( + at.torch.compose.ui.view.state.NostrEventDetailUIState.Loaded( localNostrEvent = localNostrEvent ) } else { - _root_ide_package_.at.torch.compose.ui.view.state.NostrEventDetailUIState.Error + at.torch.compose.ui.view.state.NostrEventDetailUIState.Error } } } @@ -85,7 +85,7 @@ class NostrEventDetailViewModel( fun factory( nostrEventId: HexKey, activeUserPublicKey: HexKey, - initialNostrEventDetailUIState: at.torch.compose.ui.view.state.NostrEventDetailUIState = _root_ide_package_.at.torch.compose.ui.view.state.NostrEventDetailUIState.Loading, + initialNostrEventDetailUIState: at.torch.compose.ui.view.state.NostrEventDetailUIState = at.torch.compose.ui.view.state.NostrEventDetailUIState.Loading, nostrRepository: at.torch.compose.repository.NostrRepository, ): ViewModelProvider.Factory = viewModelFactory { initializer { diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/NotaryViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/NotaryViewModel.kt index ee34de09..8d11e9a7 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/NotaryViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/NotaryViewModel.kt @@ -103,7 +103,7 @@ class NotaryViewModel( sig = event.sig, unsignedNostrEventId = unsignedNostrEvent.id ), - relayURLs = _root_ide_package_.at.torch.compose.nostr.Relays.eventPublishRelaySet.map { normalizedRelayUrl -> normalizedRelayUrl.url }, + relayURLs = at.torch.compose.nostr.Relays.eventPublishRelaySet.map { normalizedRelayUrl -> normalizedRelayUrl.url }, activeKeyPair = keyPair ) } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SearchResultViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SearchResultViewModel.kt index e9711ef3..bf282465 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SearchResultViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SearchResultViewModel.kt @@ -31,11 +31,11 @@ class SearchResultViewModel( private set var searchResultListUIState: at.torch.compose.ui.view.state.SearchResultListUIState by mutableStateOf( - _root_ide_package_.at.torch.compose.ui.view.state.SearchResultListUIState.Loading) + at.torch.compose.ui.view.state.SearchResultListUIState.Loading) private set fun updateSearchResultType (searchResultType: SearchResultType) { - searchResultListUIState = _root_ide_package_.at.torch.compose.ui.view.state.SearchResultListUIState.Loading + searchResultListUIState = at.torch.compose.ui.view.state.SearchResultListUIState.Loading this.searchResultType = searchResultType @@ -78,7 +78,7 @@ class SearchResultViewModel( viewModelScope.launch(Dispatchers.IO) { // Sync Notifications... might want to also run this in the background searchRepository.submitSearch( - _root_ide_package_.at.torch.compose.nostr.Relays.eventFinderRelaySet.take(1).map { normalizedRelay -> // TODO: Search all relays instead of the first + at.torch.compose.nostr.Relays.eventFinderRelaySet.take(1).map { normalizedRelay -> // TODO: Search all relays instead of the first _root_ide_package_.at.torch.compose.database.model.SynchronizeNostrEventRequest( purpose = "search", synchronizationFilters = arrayOf( @@ -97,7 +97,7 @@ class SearchResultViewModel( viewModelScope.launch(Dispatchers.IO) { // This is something not taking into consideration the results we are actually looking for... nostrRepository.observeNostrFeed(synchronizationFilter).distinctUntilChanged().collect { localNostrEvents -> - searchResultListUIState = _root_ide_package_.at.torch.compose.ui.view.state.SearchResultListUIState.Loaded( + searchResultListUIState = at.torch.compose.ui.view.state.SearchResultListUIState.Loaded( localNostrEvents = localNostrEvents ) } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SearchViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SearchViewModel.kt index eb21e245..3f0aab5f 100755 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SearchViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SearchViewModel.kt @@ -76,7 +76,7 @@ class SearchViewModel( const val TAG = "SearchViewModel" fun factory( - initialSearchUIState: at.torch.compose.ui.view.state.SearchUIState = _root_ide_package_.at.torch.compose.ui.view.state.SearchUIState.Prompt, + initialSearchUIState: at.torch.compose.ui.view.state.SearchUIState = at.torch.compose.ui.view.state.SearchUIState.Prompt, nostrRepository: at.torch.compose.repository.NostrRepository, searchRepository: at.torch.compose.repository.SearchRepository, ): ViewModelProvider.Factory = viewModelFactory { diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SignInToProfileViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SignInToProfileViewModel.kt index 752b7fbb..1b31fb28 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SignInToProfileViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SignInToProfileViewModel.kt @@ -78,7 +78,7 @@ class SignInToProfileViewModel( } else -> { // TODO: Might want to give reasons for the error. - signInToProfileUIState.value = _root_ide_package_.at.torch.compose.ui.view.state.SignInToProfileUIState.Error + signInToProfileUIState.value = at.torch.compose.ui.view.state.SignInToProfileUIState.Error } } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SovereignWalletViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SovereignWalletViewModel.kt index 41fa8245..a5c9d16e 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SovereignWalletViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SovereignWalletViewModel.kt @@ -82,16 +82,16 @@ class SovereignWalletViewModel( .stateIn(viewModelScope, started = SharingStarted.Lazily, initialValue = emptyList()) var walletUIState: at.torch.compose.ui.view.state.SovereignWalletUIState by mutableStateOf( - _root_ide_package_.at.torch.compose.ui.view.state.SovereignWalletUIState.Loading) + at.torch.compose.ui.view.state.SovereignWalletUIState.Loading) private set fun retryLoad() { - walletUIState = _root_ide_package_.at.torch.compose.ui.view.state.SovereignWalletUIState.Loading + walletUIState = at.torch.compose.ui.view.state.SovereignWalletUIState.Loading } fun loadSovereignData(walletId: WalletId) { - walletUIState = _root_ide_package_.at.torch.compose.ui.view.state.SovereignWalletUIState.Success( + walletUIState = at.torch.compose.ui.view.state.SovereignWalletUIState.Success( publicKey = walletId.nodeIdHash, balanceInSatoshis = 0 // TODO: Get balance... ) @@ -154,7 +154,7 @@ class SovereignWalletViewModel( phoenixGlobal = phoenixGlobal, walletId = walletId, name = null, - avatar = _root_ide_package_.at.torch.compose.ui.composable.widgets.wallet.WalletAvatars.list.random(), + avatar = at.torch.compose.ui.composable.widgets.wallet.WalletAvatars.list.random(), isHidden = false ) } diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SynchronizationViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SynchronizationViewModel.kt index 21c897a1..65cc3a04 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SynchronizationViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/SynchronizationViewModel.kt @@ -40,8 +40,8 @@ class SynchronizationViewModel( val relaysSocketManager = _root_ide_package_.at.torch.compose.network.relays.RelaysSocketManager( activeWalletStateFlow = activeWalletStateFlow, - nostrSocketClientFactory = _root_ide_package_.at.torch.compose.network.sockets.NostrSocketClientFactory, - cachingImportRepository = _root_ide_package_.at.torch.compose.repository.CachingImportRepository.Companion.NO_OP_CACHING_IMPORT_REPOSITORY, + nostrSocketClientFactory = at.torch.compose.network.sockets.NostrSocketClientFactory, + cachingImportRepository = at.torch.compose.repository.CachingImportRepository.NO_OP_CACHING_IMPORT_REPOSITORY, relayRepository = relayRepository, ) @@ -382,7 +382,7 @@ class SynchronizationViewModel( scope.launch(Dispatchers.IO) { relaysSocketManager.publishEvent( localBroadcastNostrEventRequest.nostrEvent - ).timeout(_root_ide_package_.at.torch.compose.network.relays.RelayPool.Companion.PUBLISH_TIMEOUT.milliseconds).catch { + ).timeout(at.torch.compose.network.relays.RelayPool.PUBLISH_TIMEOUT.milliseconds).catch { // Timeout... }.collect { nostrPublishResult -> if (nostrPublishResult.error != null) { @@ -409,7 +409,7 @@ class SynchronizationViewModel( setOf( localBroadcastNostrEventRequest.broadcastNostrEventRequest.relayURL.toRelayDTO() ) - ).timeout(_root_ide_package_.at.torch.compose.network.relays.RelayPool.Companion.PUBLISH_TIMEOUT.milliseconds).catch { + ).timeout(at.torch.compose.network.relays.RelayPool.PUBLISH_TIMEOUT.milliseconds).catch { // Timeout... }.collect { nostrPublishResult -> if (nostrPublishResult.error != null) { diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/UnqueuedProfileSynchronizationViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/UnqueuedProfileSynchronizationViewModel.kt index 7d488c9d..16ec91a3 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/UnqueuedProfileSynchronizationViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/UnqueuedProfileSynchronizationViewModel.kt @@ -55,7 +55,7 @@ class UnqueuedProfileSynchronizationViewModel( delay(2_000) nostrRepository.queueSynchronizeNostrEvent( - _root_ide_package_.at.torch.compose.nostr.Relays.eventPublishRelaySet.map { normalizedRelayUrl -> + at.torch.compose.nostr.Relays.eventPublishRelaySet.map { normalizedRelayUrl -> _root_ide_package_.at.torch.compose.database.model.SynchronizeNostrEventRequest( purpose = "sign-in", synchronizationFilters = arrayOf( diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/WriteNewNoteViewModel.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/WriteNewNoteViewModel.kt index 176f8e49..0215842a 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/WriteNewNoteViewModel.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/ui/view/model/WriteNewNoteViewModel.kt @@ -121,13 +121,13 @@ class WriteNewNoteViewModel( activePublicKey ).collect { profileWithFollowing -> writeNewNoteUIState = if (profileWithFollowing != null) { - _root_ide_package_.at.torch.compose.ui.view.state.WriteNewNoteUIState.InputPrompt( + at.torch.compose.ui.view.state.WriteNewNoteUIState.InputPrompt( localProfile = profileWithFollowing, inReplyToNostrEvent = nostrEventBeingRepliedTo, quotedNostrEvent = nostrEventBeingQuoted ) } else { - _root_ide_package_.at.torch.compose.ui.view.state.WriteNewNoteUIState.Error + at.torch.compose.ui.view.state.WriteNewNoteUIState.Error } } } @@ -141,7 +141,7 @@ class WriteNewNoteViewModel( validateInput().let { isInputValid -> if (isInputValid) { writeNewNoteUIState = - _root_ide_package_.at.torch.compose.ui.view.state.WriteNewNoteUIState.ConfirmNote( + at.torch.compose.ui.view.state.WriteNewNoteUIState.ConfirmNote( localProfile = localProfile, inReplyToNostrEvent = inReplyToNostrEvent, quotedNostrEvent = quotedNostrEvent, @@ -172,7 +172,7 @@ class WriteNewNoteViewModel( isActionPending.value = true viewModelScope.launch(Dispatchers.IO) { - val mentionedPublicKeys = _root_ide_package_.at.torch.compose.ui.composable.widgets.content.ContentParser.parse( + val mentionedPublicKeys = at.torch.compose.ui.composable.widgets.content.ContentParser.parse( writeNewNoteFormState.textField.textFieldState.text.toString(), ).filterIsInstance().map { it.pubkey } @@ -183,7 +183,7 @@ class WriteNewNoteViewModel( inReplyToNostrEvent = inReplyToNostrEvent, quotedNostrEvent = quotedNostrEvent, onError = { - writeNewNoteUIState = _root_ide_package_.at.torch.compose.ui.view.state.WriteNewNoteUIState.Error + writeNewNoteUIState = at.torch.compose.ui.view.state.WriteNewNoteUIState.Error }, onSuccess = onNostrEventPublished ) diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/controllers/init/RestoreWallet.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/controllers/init/RestoreWallet.kt index dc5c096c..7e5fb805 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/controllers/init/RestoreWallet.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/controllers/init/RestoreWallet.kt @@ -28,8 +28,7 @@ object RestoreWallet { if (this === other) return true if (other == null || this::class != other::class) return false other as ValidMnemonics - if (!seed.contentEquals(other.seed)) return false - return true + return seed.contentEquals(other.seed) } override fun hashCode(): Int { diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/AppConfiguration.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/AppConfiguration.kt index 65725dfe..cb00c2c0 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/AppConfiguration.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/AppConfiguration.kt @@ -203,12 +203,12 @@ enum class FiatCurrency(override val displayCode: String, val flag: String = " suspend fun getLabel(): Pair { val fullName = when { // use the free market rates as default. Name for official rates gets a special tag, as those rates are usually inaccurate. - this == FiatCurrency.ARS -> getString(Res.string.currency_ars_official) - this == FiatCurrency.ARS_BM -> getString(Res.string.currency_ars_bm) - this == FiatCurrency.CUP -> getString(Res.string.currency_cup_official) - this == FiatCurrency.CUP_FM -> getString(Res.string.currency_cup_fm) - this == FiatCurrency.LBP -> getString(Res.string.currency_lbp_official) - this == FiatCurrency.LBP_BM -> getString(Res.string.currency_lbp_bm) + this == ARS -> getString(Res.string.currency_ars_official) + this == ARS_BM -> getString(Res.string.currency_ars_bm) + this == CUP -> getString(Res.string.currency_cup_official) + this == CUP_FM -> getString(Res.string.currency_cup_fm) + this == LBP -> getString(Res.string.currency_lbp_official) + this == LBP_BM -> getString(Res.string.currency_lbp_bm) // use the JVM API otherwise to get the name this.displayCode.length == 3 -> try { this.name diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/Lnurl.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/Lnurl.kt index 6b8ec684..622984b4 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/Lnurl.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/Lnurl.kt @@ -115,7 +115,7 @@ sealed interface Lnurl { Tag.Auth -> { val k1 = url.parameters["k1"] if (k1.isNullOrBlank()) { - throw LnurlError.Auth.MissingK1 + throw LnurlError.Auth.MissingK1() } else { LnurlAuth(url, k1) } @@ -129,7 +129,7 @@ sealed interface Lnurl { val (_, data) = Bech32.decode(source) val payload = Bech32.five2eight(data, 0).decodeToString() val url = URLBuilder(payload).build() - if (!url.protocol.isSecure()) throw LnurlError.UnsafeResource + if (!url.protocol.isSecure()) throw LnurlError.UnsafeResource() return url } @@ -141,7 +141,7 @@ sealed interface Lnurl { // this url contains a lnurl fallback which takes priority - and must be bech32 encoded parseBech32Url(lightningParam) } else { - if (!urlBuilder.protocol.isSecure()) throw LnurlError.UnsafeResource + if (!urlBuilder.protocol.isSecure()) throw LnurlError.UnsafeResource() urlBuilder.build() } } @@ -217,12 +217,12 @@ sealed interface Lnurl { /** Converts a lnurl JSON response to a [Lnurl] object. */ fun parseLnurlJson(url: Url, json: JsonObject): Lnurl { - val callback = URLBuilder(json["callback"]?.jsonPrimitive?.content ?: throw LnurlError.MissingCallback).build() - if (!callback.protocol.isSecure()) throw LnurlError.UnsafeResource - val tag = json["tag"]?.jsonPrimitive?.content?.takeIf { it.isNotBlank() } ?: throw LnurlError.NoTag + val callback = URLBuilder(json["callback"]?.jsonPrimitive?.content ?: throw LnurlError.MissingCallback()).build() + if (!callback.protocol.isSecure()) throw LnurlError.UnsafeResource() + val tag = json["tag"]?.jsonPrimitive?.content?.takeIf { it.isNotBlank() } ?: throw LnurlError.NoTag() return when (tag) { Tag.Withdraw.label -> { - val k1 = json["k1"]?.jsonPrimitive?.content?.takeIf { it.isNotBlank() } ?: throw LnurlError.Withdraw.MissingK1 + val k1 = json["k1"]?.jsonPrimitive?.content?.takeIf { it.isNotBlank() } ?: throw LnurlError.Withdraw.MissingK1() val minWithdrawable = json["minWithdrawable"]?.jsonPrimitive?.doubleOrNull?.takeIf { it > 0f }?.toLong()?.msat ?: json["minWithdrawable"]?.jsonPrimitive?.long?.takeIf { it > 0 }?.msat ?: 0.msat @@ -242,11 +242,11 @@ sealed interface Lnurl { Tag.Pay.label -> { val minSendable = json["minSendable"]?.jsonPrimitive?.doubleOrNull?.takeIf { it > 0f }?.toLong()?.msat ?: json["minSendable"]?.jsonPrimitive?.longOrNull?.takeIf { it > 0 }?.msat - ?: throw LnurlError.Pay.Intent.InvalidMin + ?: throw LnurlError.Pay.Intent.InvalidMin() val maxSendable = json["maxSendable"]?.jsonPrimitive?.doubleOrNull?.takeIf { it > 0f }?.toLong()?.msat ?: json["maxSendable"]?.jsonPrimitive?.longOrNull?.coerceAtLeast(minSendable.msat)?.msat - ?: throw LnurlError.Pay.Intent.MissingMax - val metadata = LnurlPay.parseMetadata(json["metadata"]?.jsonPrimitive?.content ?: throw LnurlError.Pay.Intent.MissingMetadata) + ?: throw LnurlError.Pay.Intent.MissingMax() + val metadata = LnurlPay.parseMetadata(json["metadata"]?.jsonPrimitive?.content ?: throw LnurlError.Pay.Intent.MissingMetadata()) val maxCommentLength = json["commentAllowed"]?.jsonPrimitive?.longOrNull?.takeIf { it > 0 } LnurlPay.Intent( initialUrl = url, diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/LnurlAuth.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/LnurlAuth.kt index d01565ba..89cb99f0 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/LnurlAuth.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/LnurlAuth.kt @@ -166,7 +166,7 @@ data class LnurlAuth( /** Get the legacy domain for the given [Url] if eligible, or the full domain name otherwise (i.e. specs compliant). */ fun filterDomain(url: Url): String { - return entries.firstOrNull() { it.host == url.host }?.legacyCompatDomain ?: url.host + return entries.firstOrNull { it.host == url.host }?.legacyCompatDomain ?: url.host } } } diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/LnurlError.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/LnurlError.kt index 0f514eac..83d1bf48 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/LnurlError.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/LnurlError.kt @@ -22,18 +22,18 @@ sealed class LnurlError(override val message: String? = null) : RuntimeException val details: String by lazy { "Lnurl error=${message ?: this::class.simpleName ?: "N/A"} in url=" } sealed class Auth(override val message: String?) : LnurlError(message) { - object MissingK1 : Auth("missing k1 parameter") + class MissingK1 : Auth("missing k1 parameter") } sealed class Withdraw(override val message: String?) : LnurlError(message) { - object MissingK1 : Withdraw("missing k1 parameter in auth metadata") + class MissingK1 : Withdraw("missing k1 parameter in auth metadata") } sealed class Pay : LnurlError() { sealed class Intent(override val message: String?) : LnurlError(message) { - object InvalidMin : Intent("invalid minimum amount") - object MissingMax : Intent("missing maximum amount parameter") - object MissingMetadata : Intent("missing metadata parameter") + class InvalidMin : Intent("invalid minimum amount") + class MissingMax : Intent("missing maximum amount parameter") + class MissingMetadata : Intent("missing metadata parameter") data class InvalidMetadata(val meta: String) : Intent("invalid meta=$meta") } @@ -50,10 +50,10 @@ sealed class LnurlError(override val message: String? = null) : RuntimeException } data class Invalid(override val cause: Throwable?) : LnurlError("cannot be parsed as a bech32 or as a human readable lnurl") - object NoTag : LnurlError("no tag field found") + class NoTag : LnurlError("no tag field found") data class UnhandledTag(val tag: String) : LnurlError("unhandled tag=$tag") - object UnsafeResource : LnurlError("resource should be https") - object MissingCallback : LnurlError("missing callback in metadata response") + class UnsafeResource : LnurlError("resource should be https") + class MissingCallback : LnurlError("missing callback in metadata response") sealed class RemoteFailure(override val message: String) : LnurlError(message) { abstract val origin: String diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/LnurlPay.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/LnurlPay.kt index d8256c54..46df0960 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/LnurlPay.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/data/lnurl/LnurlPay.kt @@ -180,7 +180,7 @@ sealed class LnurlPay : Lnurl.Qualified { } /** Decode a serialized [Lnurl.Pay.Metadata] object. */ - fun parseMetadata(raw: String): LnurlPay.Intent.Metadata = try { + fun parseMetadata(raw: String): Intent.Metadata = try { val array = format.decodeFromString(raw) var plainText: String? = null var longDesc: String? = null @@ -204,7 +204,7 @@ sealed class LnurlPay : Lnurl.Qualified { Logger.w("LnurlPay") { "could not decode raw lnurlpay-meta=$it: ${e.message}" } } } - LnurlPay.Intent.Metadata( + Intent.Metadata( raw = raw, plainText = plainText!!, longDesc = longDesc, diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/db/cloud/payments/CloudData.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/db/cloud/payments/CloudData.kt index 168f63ce..02c82bf0 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/db/cloud/payments/CloudData.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/db/cloud/payments/CloudData.kt @@ -88,7 +88,7 @@ sealed class CloudData { * This function exists because the Kotlin-generated * copy function doesn't translate to iOS very well. */ - fun copyWithPadding(padding: ByteArray): CloudData.V0 { + fun copyWithPadding(padding: ByteArray): V0 { return this.copy(padding = padding) } diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/db/payments/CloudKitInterface.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/db/payments/CloudKitInterface.kt index 8ef32082..5b32d480 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/db/payments/CloudKitInterface.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/db/payments/CloudKitInterface.kt @@ -1,5 +1,4 @@ package fr.acinq.phoenix.db.payments /* Cross-platform placeholder for CloudKitDb. */ -interface CloudKitInterface { -} \ No newline at end of file +interface CloudKitInterface \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/AppConfigurationManager.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/AppConfigurationManager.kt index 77381e6a..59922d66 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/AppConfigurationManager.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/AppConfigurationManager.kt @@ -83,7 +83,7 @@ class AppConfigurationManager( // Tor configuration private val _isTorEnabled = MutableStateFlow(null) val isTorEnabled get(): StateFlow = _isTorEnabled.asStateFlow() - fun updateTorUsage(enabled: Boolean): Unit { + fun updateTorUsage(enabled: Boolean) { _isTorEnabled.value = enabled } diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/PinManager.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/PinManager.kt index 9c392809..806cbabd 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/PinManager.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/PinManager.kt @@ -56,7 +56,7 @@ object PinManager { fun getLockPinMapFromDisk(): Map { val encryptedPin = getEncryptedPinFromDisk( LOCK_PIN_FILE_NAME)?.let { - EncryptedPinLock.Companion.deserialize(it) + EncryptedPinLock.deserialize(it) } return when (encryptedPin) { is EncryptedPinLock.SingleWallet -> { @@ -70,7 +70,7 @@ object PinManager { fun getSpendingPinMapFromDisk(): Map { val encryptedPin = getEncryptedPinFromDisk(SPENDING_PIN_FILE_NAME)?.let { - EncryptedPinSpending.Companion.deserialize(it) + EncryptedPinSpending.deserialize(it) } return when (encryptedPin) { is EncryptedPinSpending.SingleWallet -> { @@ -83,7 +83,7 @@ object PinManager { } fun writeLockPinMapToDisk(pinMap: Map) { - val encryptedPin = EncryptedPinLock.Companion.encrypt(pinMap) + val encryptedPin = EncryptedPinLock.encrypt(pinMap) val datadir = getDataDir() val temp = datadir.resolve("temporary_pin.dat") @@ -99,7 +99,7 @@ object PinManager { } fun writeSpendingPinMapToDisk(pinMap: Map) { - val encryptedPin = EncryptedPinSpending.Companion.encrypt(pinMap) + val encryptedPin = EncryptedPinSpending.encrypt(pinMap) val datadir = getDataDir() val temp = datadir.resolve("temporary_pin.dat") @@ -128,7 +128,7 @@ object PinManager { } val encryptedSpendingPin = getEncryptedPinFromDisk( SPENDING_PIN_FILE_NAME)?.let { - EncryptedPinSpending.Companion.deserialize(it) + EncryptedPinSpending.deserialize(it) } when (encryptedSpendingPin) { is EncryptedPinSpending.SingleWallet -> { diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/SeedManager.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/SeedManager.kt index 2f21c603..03cdec8b 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/SeedManager.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/SeedManager.kt @@ -178,6 +178,6 @@ object SeedManager { FileSystem.SYSTEM.delete(temp) } - object WriteErrorCheckDontMatch : RuntimeException("failed to write the seed to disk: temporary file do not match") + class WriteErrorCheckDontMatch : RuntimeException("failed to write the seed to disk: temporary file do not match") class UnreadableSeed(msg: String) : RuntimeException(msg) } \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/SendManager.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/SendManager.kt index a0a8af8d..b6283a19 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/SendManager.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/SendManager.kt @@ -72,9 +72,9 @@ class SendManager( private val log = loggerFactory.newLogger(this::class) sealed class BadRequestReason : Exception() { - data object UnknownFormat : BadRequestReason() - data object AlreadyPaidInvoice : BadRequestReason() - data object PaymentPending : BadRequestReason() + class UnknownFormat : BadRequestReason() + class AlreadyPaidInvoice : BadRequestReason() + class PaymentPending : BadRequestReason() data class Expired(val timestampSeconds: Long, val expirySeconds: Long) : BadRequestReason() data class ChainMismatch(val expected: Chain) : BadRequestReason() data class ServiceError(val url: Url, val error: LnurlError.RemoteFailure) : BadRequestReason() @@ -173,7 +173,7 @@ class SendManager( } ?: run { ParseResult.BadRequest( request = request, - reason = BadRequestReason.UnknownFormat + reason = BadRequestReason.UnknownFormat() ) } } catch (e: Exception) { @@ -185,7 +185,7 @@ class SendManager( } else { ParseResult.BadRequest( request = request, - reason = BadRequestReason.UnknownFormat + reason = BadRequestReason.UnknownFormat() ) } } @@ -224,9 +224,9 @@ class SendManager( // FIXME: this check should be done in lightning-kmp, not in Phoenix return when { similarPayments.any { it.status is LightningOutgoingPayment.Status.Succeeded || it.parts.any { part -> part.status is LightningOutgoingPayment.Part.Status.Succeeded } } -> - BadRequestReason.AlreadyPaidInvoice + BadRequestReason.AlreadyPaidInvoice() similarPayments.any { it.status is LightningOutgoingPayment.Status.Pending || it.parts.any { part -> part.status is LightningOutgoingPayment.Part.Status.Pending } } -> - BadRequestReason.PaymentPending + BadRequestReason.PaymentPending() else -> null } } @@ -418,7 +418,7 @@ class SendManager( address.isNotBlank() -> ParseResult.Uri(uri = result.value) bolt11 != null -> ParseResult.Bolt11Invoice(request = input, invoice = bolt11) bolt12 != null -> ParseResult.Bolt12Offer(offer = bolt12, lightningAddress = null) - else -> ParseResult.BadRequest(request = input, reason = BadRequestReason.UnknownFormat) + else -> ParseResult.BadRequest(request = input, reason = BadRequestReason.UnknownFormat()) } } is Either.Left -> { @@ -426,7 +426,7 @@ class SendManager( if (error is BitcoinUriError.InvalidScript && error.error is BitcoinError.ChainHashMismatch) { ParseResult.BadRequest(request = input, reason = BadRequestReason.ChainMismatch(expected = chain)) } else { - ParseResult.BadRequest(request = input, reason = BadRequestReason.UnknownFormat) + ParseResult.BadRequest(request = input, reason = BadRequestReason.UnknownFormat()) } } } diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/global/CurrencyManager.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/global/CurrencyManager.kt index 69cd2c64..b9b6eb40 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/global/CurrencyManager.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/global/CurrencyManager.kt @@ -92,7 +92,7 @@ class CurrencyManager( val ratesFlow: StateFlow> by lazy { appDb.listBitcoinRates().stateIn( scope = scope, - started = SharingStarted.Companion.Eagerly, + started = SharingStarted.Eagerly, initialValue = listOf() ) } @@ -287,9 +287,9 @@ class CurrencyManager( .filter { targets.contains(it.fiatCurrency) } for (fiatCurrency in targets) { val lastRefresh = dbValues.firstOrNull { it.fiatCurrency == fiatCurrency }?.let { - Instant.Companion.fromEpochMilliseconds(it.timestampMillis) + Instant.fromEpochMilliseconds(it.timestampMillis) } ?: run { - Instant.Companion.fromEpochMilliseconds(0) + Instant.fromEpochMilliseconds(0) } refreshList[fiatCurrency] = RefreshInfo( lastRefresh = lastRefresh, @@ -307,7 +307,7 @@ class CurrencyManager( val now = Clock.System.now() return if (nextRefresh == null || nextRefresh <= now) { - Duration.Companion.ZERO + Duration.ZERO } else { nextRefresh - now } @@ -397,8 +397,8 @@ class CurrencyManager( val failCount: Int ) { constructor() : this( - lastRefresh = Instant.Companion.fromEpochMilliseconds(0), - nextRefresh = Instant.Companion.fromEpochMilliseconds(0), + lastRefresh = Instant.fromEpochMilliseconds(0), + nextRefresh = Instant.fromEpochMilliseconds(0), failCount = 0 ) diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/global/fiatapis/CoinbaseApi.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/global/fiatapis/CoinbaseApi.kt index fb2c5a7b..e870d004 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/global/fiatapis/CoinbaseApi.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/managers/global/fiatapis/CoinbaseApi.kt @@ -39,7 +39,7 @@ class CoinbaseAPI(loggerFactory: LoggerFactory) : ExchangeRateApi { override val name = "coinbase" override val refreshDelay = 60.minutes - override val fiatCurrencies = FiatCurrency.Companion.values.filter { + override val fiatCurrencies = FiatCurrency.values.filter { // bascially, everything except USD, EURO, and special markets !ExchangeRateApi.highLiquidityMarkets.contains(it) && !ExchangeRateApi.specialMarkets.contains(it) && !ExchangeRateApi.missingFromCoinbase.contains(it) }.toSet() diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/security/EncryptedPinLock.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/security/EncryptedPinLock.kt index eecd0bcd..ae4615b8 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/security/EncryptedPinLock.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/security/EncryptedPinLock.kt @@ -56,8 +56,7 @@ sealed class EncryptedPinLock: EncryptedPin.KeystoreEncrypted() { fun deserialize(serialized: ByteArray): EncryptedPinLock { val stream = Buffer().write(serialized) - val version = stream.readByte() - when (version) { + when (val version = stream.readByte()) { SINGLE_WALLET_VERSION, MULTIPLE_WALLET_VERSION -> { val (iv, ciphertext) = deserialize(stream) return when (version) { diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/security/EncryptedPinSpending.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/security/EncryptedPinSpending.kt index ddebce87..5c3308b1 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/security/EncryptedPinSpending.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/security/EncryptedPinSpending.kt @@ -62,8 +62,7 @@ sealed class EncryptedPinSpending: EncryptedPin.KeystoreEncrypted() { fun deserialize(serialized: ByteArray): EncryptedPinSpending { val stream = Buffer().write(serialized) - val version = stream.readByte() - when (version) { + when (val version = stream.readByte()) { SINGLE_WALLET_VERSION, MULTIPLE_WALLET_VERSION -> { val (iv, ciphertext) = deserialize(stream) return when (version) { diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/utils/Cache.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/utils/Cache.kt index 89d7a2ce..1df9c161 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/utils/Cache.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/utils/Cache.kt @@ -116,7 +116,7 @@ class Cache(sizeLimit: Int) { } } - operator fun set(key: Key, value: Value): Unit { + operator fun set(key: Key, value: Value) { val existingItem = _map[key] if (existingItem != null) { @@ -192,7 +192,7 @@ class Cache(sizeLimit: Int) { } } - fun remove(key: Key): Unit { + fun remove(key: Key) { _map[key]?.let { item -> @@ -212,7 +212,7 @@ class Cache(sizeLimit: Int) { } } - fun clear(): Unit { + fun clear() { var item = leastRecentCacheItem while (item != null) { diff --git a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/utils/preferences/InternalPrefs.kt b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/utils/preferences/InternalPrefs.kt index ec1515d9..d66b65c3 100644 --- a/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/utils/preferences/InternalPrefs.kt +++ b/composeApp/src/commonMain/kotlin/fr/acinq/phoenix/utils/preferences/InternalPrefs.kt @@ -43,7 +43,7 @@ class InternalPrefs(private val internalData: DataStore) { private val LAST_REJECTED_ONCHAIN_SWAP_TIMESTAMP = longPreferencesKey("LAST_REJECTED_ONCHAIN_SWAP_TIMESTAMP") private val SEED_MANUAL_BACKUP_DONE = booleanPreferencesKey("SEED_MANUAL_BACKUP_DONE") private val SEED_LOSS_DISCLAIMER_READ = booleanPreferencesKey("SEED_LOSS_DISCLAIMER_READ") - internal val CHANNELS_WATCHER_OUTCOME = stringPreferencesKey("CHANNELS_WATCHER_RESULT") + val CHANNELS_WATCHER_OUTCOME = stringPreferencesKey("CHANNELS_WATCHER_RESULT") private val LAST_USED_SWAP_INDEX = intPreferencesKey("LAST_USED_SWAP_INDEX") private val INFLIGHT_PAYMENTS_COUNT = intPreferencesKey("INFLIGHT_PAYMENTS_COUNT") private val SHOW_SPLICEOUT_CAPACITY_DISCLAIMER = booleanPreferencesKey("SHOW_SPLICEOUT_CAPACITY_DISCLAIMER") diff --git a/composeApp/src/iosMain/kotlin/fr/acinq/phoenix/ios/BusinessManager.kt b/composeApp/src/iosMain/kotlin/fr/acinq/phoenix/ios/BusinessManager.kt index 53e2f5f3..0f6f6078 100644 --- a/composeApp/src/iosMain/kotlin/fr/acinq/phoenix/ios/BusinessManager.kt +++ b/composeApp/src/iosMain/kotlin/fr/acinq/phoenix/ios/BusinessManager.kt @@ -225,7 +225,7 @@ object BusinessManager { nodeParamsManager.nodeParams.filterNotNull().first().nodeEvents ) { nextTimeout, nodeEvent -> nextTimeout to nodeEvent - }.collect { (nextTimeout, event) -> + }.collect { (_, event) -> // TODO: click on notif must deeplink to the notification screen when (event) { is LiquidityEvents.Rejected -> { @@ -246,7 +246,7 @@ object BusinessManager { internalPrefs.saveLastRejectedOnchainSwap(event) } } - val walletMetadata = globalPrefs.getAvailableWalletsMeta.first().getByWalletIdOrDefault(walletId) + globalPrefs.getAvailableWalletsMeta.first().getByWalletIdOrDefault(walletId) when (val reason = event.reason) { is LiquidityEvents.Rejected.Reason.PolicySetToDisabled -> { // TODO: SystemNotificationHelper.notifyPaymentRejectedPolicyDisabled(appContext, walletId, walletMetadata, event.source, event.amount, nextTimeout?.second) diff --git a/composeApp/src/iosMain/kotlin/fr/acinq/phoenix/security/CCCipher.kt b/composeApp/src/iosMain/kotlin/fr/acinq/phoenix/security/CCCipher.kt index f383745f..b0b6bcba 100644 --- a/composeApp/src/iosMain/kotlin/fr/acinq/phoenix/security/CCCipher.kt +++ b/composeApp/src/iosMain/kotlin/fr/acinq/phoenix/security/CCCipher.kt @@ -41,7 +41,7 @@ import platform.posix.size_tVar private val almostEmptyArrayPinned = ByteArray(1).pin() @ExperimentalForeignApi -public fun ByteArray.safeRefTo(index: Int): CValuesRef { +fun ByteArray.safeRefTo(index: Int): CValuesRef { if (index == size) return almostEmptyArrayPinned.addressOf(0) return refTo(index) }