feat: improve search and handle input in compose (#67)

* feat: support search by npub or nprofile

* .

* .

* .

* chore: prevent update local search with empty result

* clean up

* .
This commit is contained in:
reya
2025-06-25 15:03:05 +07:00
committed by GitHub
parent c7e3331eb0
commit edee9305cc
7 changed files with 550 additions and 314 deletions

View File

@@ -144,6 +144,15 @@ impl ChatRegistry {
.collect()
}
/// Search rooms by public keys.
pub fn search_by_public_key(&self, public_key: PublicKey, cx: &App) -> Vec<Entity<Room>> {
self.rooms
.iter()
.filter(|room| room.read(cx).members.contains(&public_key))
.cloned()
.collect()
}
/// Load all rooms from the lmdb.
///
/// This method: