diff --git a/app/src/main/java/com/vitorpamplona/amethyst/service/NostrAccountDataSource.kt b/app/src/main/java/com/vitorpamplona/amethyst/service/NostrAccountDataSource.kt index a42454ace..be0e7e8f2 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/service/NostrAccountDataSource.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/service/NostrAccountDataSource.kt @@ -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 { diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/ChatroomFeedFilter.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/ChatroomFeedFilter.kt index 4d1a05f7f..ad1c39204 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/ChatroomFeedFilter.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/ChatroomFeedFilter.kt @@ -43,9 +43,7 @@ class ChatroomFeedFilter(val withUser: ChatroomKey, val account: Account) : override fun applyFilter(collection: Set): Set { 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): List {