chore: update deps

This commit is contained in:
2026-08-31 16:54:38 +07:00
parent 49cd5cb9a0
commit 2f834a0bcc
10 changed files with 540 additions and 661 deletions
+16 -5
View File
@@ -84,8 +84,20 @@ impl Screening {
let task: Task<Result<bool, Error>> = cx.background_spawn(async move {
// Check if user is in contact list
let contacts = client.database().contacts_public_keys(current_user).await;
let followed = contacts.unwrap_or_default().contains(&public_key);
let filter = Filter::new()
.author(current_user)
.kind(Kind::ContactList)
.limit(1);
let followed = client
.database()
.query(filter)
.await
.unwrap_or_default()
.into_iter()
.next()
.map(|event| event.tags.public_keys().any(|k| k == public_key))
.unwrap_or(false);
Ok(followed)
});
@@ -228,11 +240,10 @@ impl Screening {
let public_key = self.public_key;
let task: Task<Result<(), Error>> = cx.background_spawn(async move {
let tag = Nip56Tag::PublicKey {
let tag = Tag::from(Nip56Tag::PublicKey {
public_key,
report: Report::Impersonation,
}
.to_tag();
});
let event = EventBuilder::new(Kind::Reporting, "")
.tag(tag)
+14 -1
View File
@@ -88,7 +88,20 @@ impl ContactListPanel {
};
let task: Task<Result<HashSet<PublicKey>, Error>> = cx.background_spawn(async move {
let contact_list = client.database().contacts_public_keys(public_key).await?;
let filter = Filter::new()
.author(public_key)
.kind(Kind::ContactList)
.limit(1);
let contact_list: HashSet<PublicKey> = client
.database()
.query(filter)
.await?
.into_iter()
.next()
.map(|event| event.tags.public_keys().collect())
.unwrap_or_default();
Ok(contact_list)
});
@@ -93,7 +93,7 @@ impl MessagingRelayPanel {
.author(public_key)
.limit(1);
if let Some(event) = client.database().query(filter).await?.first_owned() {
if let Some(event) = client.database().query(filter).await?.into_iter().next() {
Ok(nip17::extract_relay_list(&event).collect())
} else {
Err(anyhow!("Not found."))
@@ -177,7 +177,7 @@ impl MessagingRelayPanel {
let tags: Vec<Tag> = self
.relays
.iter()
.map(|relay| Nip17Tag::Relay(relay.to_owned()).to_tag())
.map(|relay| Tag::from(Nip17Tag::Relay(relay.to_owned())))
.collect();
// Set updating state
+1 -1
View File
@@ -111,7 +111,7 @@ impl RelayListPanel {
.author(public_key)
.limit(1);
if let Some(event) = client.database().query(filter).await?.first_owned() {
if let Some(event) = client.database().query(filter).await?.into_iter().next() {
Ok(nip65::extract_relay_list(&event).collect())
} else {
Err(anyhow!("Not found."))
+14 -1
View File
@@ -158,7 +158,20 @@ impl Sidebar {
};
let task: Task<Result<HashSet<PublicKey>, Error>> = cx.background_spawn(async move {
let contacts = client.database().contacts_public_keys(public_key).await?;
let filter = Filter::new()
.author(public_key)
.kind(Kind::ContactList)
.limit(1);
let contacts: HashSet<PublicKey> = client
.database()
.query(filter)
.await?
.into_iter()
.next()
.map(|event| event.tags.public_keys().collect())
.unwrap_or_default();
Ok(contacts)
});