fix: no member in room (#8)

Reviewed-on: #8
This commit was merged in pull request #8.
This commit is contained in:
2026-06-01 02:53:56 +00:00
parent a3ab489d44
commit b7c5b64022
2 changed files with 5 additions and 2 deletions

View File

@@ -596,7 +596,7 @@ class Nostr {
val kTag = SingleLetterTag.lowercase(Alphabet.K)
// Get all events sent by the user
val filter = Filter().kind(kind).author(userPubkey).customTag(kTag, "dm")
val filter = Filter().kind(kind).author(userPubkey).customTag(kTag, "14")
val events = client?.database()?.query(filter)
// Collect rooms

View File

@@ -43,8 +43,11 @@ data class Room(
val pubkeys: MutableSet<PublicKey> = mutableSetOf()
pubkeys.add(rumor.author())
pubkeys.addAll(rumor.tags().publicKeys())
// Also remove the user's public key from the list, current user is always a member
pubkeys.remove(userPubkey)
if (pubkeys.size > 1 && pubkeys.contains(userPubkey)) {
pubkeys.remove(userPubkey)
}
// Create a new Room instance
return Room(