reduce lint warnings

This commit is contained in:
David Kaspar
2025-08-03 10:32:04 +02:00
parent cdfb1db253
commit fa80cb297d
2 changed files with 7 additions and 10 deletions
@@ -949,7 +949,7 @@ class AccountViewModel(
}
}
suspend fun loadReactionTo(note: Note?): String? {
fun loadReactionTo(note: Note?): String? {
if (note == null) return null
return note.getReactionBy(userProfile())
@@ -1027,7 +1027,7 @@ class AccountViewModel(
fun getUserIfExists(hex: HexKey): User? = LocalCache.getUserIfExists(hex)
private suspend fun checkGetOrCreateNote(key: HexKey): Note? = LocalCache.checkGetOrCreateNote(key)
private fun checkGetOrCreateNote(key: HexKey): Note? = LocalCache.checkGetOrCreateNote(key)
override suspend fun getOrCreateNote(key: HexKey): Note = LocalCache.getOrCreateNote(key)
@@ -1102,11 +1102,11 @@ class AccountViewModel(
)
}
suspend fun checkGetOrCreatePublicChatChannel(key: HexKey): PublicChatChannel? = LocalCache.getOrCreatePublicChatChannel(key)
fun checkGetOrCreatePublicChatChannel(key: HexKey): PublicChatChannel? = LocalCache.getOrCreatePublicChatChannel(key)
suspend fun checkGetOrCreateLiveActivityChannel(key: Address): LiveActivitiesChannel? = LocalCache.getOrCreateLiveChannel(key)
fun checkGetOrCreateLiveActivityChannel(key: Address): LiveActivitiesChannel? = LocalCache.getOrCreateLiveChannel(key)
suspend fun checkGetOrCreateEphemeralChatChannel(key: RoomId): EphemeralChatChannel? = LocalCache.getOrCreateEphemeralChannel(key)
fun checkGetOrCreateEphemeralChatChannel(key: RoomId): EphemeralChatChannel? = LocalCache.getOrCreateEphemeralChannel(key)
fun checkGetOrCreateChannel(
key: HexKey,
@@ -1660,7 +1660,7 @@ class AccountViewModel(
}
}
suspend fun findUsersStartingWithSync(prefix: String) = LocalCache.findUsersStartingWith(prefix, account)
fun findUsersStartingWithSync(prefix: String) = LocalCache.findUsersStartingWith(prefix, account)
fun relayStatusFlow() = app.client.relayStatusFlow()
@@ -46,7 +46,7 @@ class EventProcessor(
private val account: Account,
private val cache: LocalCache,
) {
private val decryptionService = DecryptionService(account, cache)
private val decryptionService = DecryptionService(account)
private val indexingService = IndexingService(account, cache)
private val chatroomService = ChatroomService(account)
private val eventHandlers = createEventHandlers()
@@ -132,10 +132,8 @@ class EventProcessor(
}
}
// Service classes following Single Responsibility Principle
class DecryptionService(
val account: Account,
private val cache: LocalCache,
) {
suspend fun unwrapGiftWrap(event: GiftWrapEvent): Event? = event.unwrapOrNull(account.signer)
@@ -251,7 +249,6 @@ class ChatroomService(
}
}
// Event handler interface and implementations following Strategy Pattern
interface EventHandler {
suspend fun process(
event: Event,