mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 16:33:27 +00:00
reduce lint warnings
This commit is contained in:
+6
-6
@@ -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()
|
||||
|
||||
|
||||
+1
-4
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user