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

@@ -11,7 +11,7 @@ pub const BOOTSTRAP_RELAYS: [&str; 4] = [
"wss://relay.damus.io",
"wss://relay.primal.net",
"wss://user.kindpag.es",
"wss://relaydiscovery.com",
"wss://purplepag.es",
];
/// NIP65 Relays. Used for new account
@@ -26,7 +26,7 @@ pub const NIP65_RELAYS: [&str; 4] = [
pub const NIP17_RELAYS: [&str; 2] = ["wss://auth.nostr1.com", "wss://relay.0xchat.com"];
/// Search Relays.
pub const SEARCH_RELAYS: [&str; 1] = ["wss://relay.nostr.band"];
pub const SEARCH_RELAYS: [&str; 2] = ["wss://search.nos.today", "wss://relay.nostr.band"];
/// Default relay for Nostr Connect
pub const NOSTR_CONNECT_RELAY: &str = "wss://relay.nsec.app";

View File

@@ -302,6 +302,12 @@ impl Globals {
})
}
pub async fn request_metadata(&self, public_key: PublicKey) {
if let Err(e) = self.batch_sender.send(public_key).await {
log::error!("Failed to request metadata: {e}")
}
}
/// Gets a person's profile from cache or creates default (blocking)
pub fn person(&self, public_key: &PublicKey) -> Profile {
let metadata = if let Some(metadata) = self.persons.read_blocking().get(public_key) {