Fixes the lack of relay icons in the NIP44 messages

This commit is contained in:
Vitor Pamplona
2024-01-06 11:24:52 -05:00
parent 5c7e9258c1
commit 0be1f89368
2 changed files with 5 additions and 5 deletions
@@ -238,14 +238,16 @@ object NostrAccountDataSource : NostrDataSource("AccountData") {
if (LocalCache.justVerify(event)) {
if (event is GiftWrapEvent) {
// Avoid decrypting over and over again if the event already exist.
if (LocalCache.getNoteIfExists(event.id) != null) return
val note = LocalCache.getNoteIfExists(event.id)
if (note != null && relay.brief in note.relays) return
event.cachedGift(account.signer) { this.consume(it, relay) }
}
if (event is SealedGossipEvent) {
// Avoid decrypting over and over again if the event already exist.
if (LocalCache.getNoteIfExists(event.id) != null) return
val note = LocalCache.getNoteIfExists(event.id)
if (note != null && relay.brief in note.relays) return
event.cachedGossip(account.signer) { LocalCache.justConsume(it, relay) }
} else {
@@ -43,9 +43,7 @@ class ChatroomFeedFilter(val withUser: ChatroomKey, val account: Account) :
override fun applyFilter(collection: Set<Note>): Set<Note> {
val messages = account.userProfile().privateChatrooms[withUser] ?: return emptySet()
return collection
.filter { it in messages.roomMessages && account.isAcceptable(it) == true }
.toSet()
return collection.filter { it in messages.roomMessages && account.isAcceptable(it) }.toSet()
}
override fun sort(collection: Set<Note>): List<Note> {