chore: update deps

This commit is contained in:
reya
2024-08-18 18:13:23 +07:00
parent 3c36db162f
commit 975819671c
6 changed files with 687 additions and 544 deletions

779
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,11 @@
[package]
name = "coop"
version = "0.0.0"
description = "A Tauri App"
authors = ["you"]
version = "0.1.0"
description = "direct message client for desktop"
authors = ["npub1zfss807aer0j26mwp2la0ume0jqde3823rmu97ra6sgyyg956e0s6xw445"]
repository = "https://github.com/lumehq/coop"
edition = "2021"
rust-version = "1.70"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@@ -201,7 +201,9 @@ pub async fn login(
let inbox = Filter::new().kind(Kind::Custom(10050)).author(public_key).limit(1);
if let Ok(events) = client.get_events_of(vec![inbox], Some(Duration::from_secs(3))).await {
if let Ok(events) =
client.get_events_of(vec![inbox], EventSource::relays(Some(Duration::from_secs(3)))).await
{
if let Some(event) = events.into_iter().next() {
let urls = event
.tags()
@@ -261,9 +263,10 @@ pub async fn login(
let fake_sig = Signature::from_str("f9e79d141c004977192d05a86f81ec7c585179c371f7350a5412d33575a2a356433f58e405c2296ed273e2fe0aafa25b641e39cc4e1f3f261ebf55bce0cbac83").unwrap();
if let Ok(events) = client
.get_events_of_with_opts(
.pool()
.get_events_of(
vec![filter],
Some(Duration::from_secs(20)),
Duration::from_secs(12),
FilterOptions::WaitDurationAfterEOSE(Duration::from_secs(20)),
)
.await

View File

@@ -12,7 +12,9 @@ async fn connect_nip65_relays(public_key: PublicKey, client: &Client) -> Vec<Str
let filter = Filter::new().author(public_key).kind(Kind::RelayList).limit(1);
let mut relay_list: Vec<String> = Vec::new();
if let Ok(events) = client.get_events_of(vec![filter], Some(Duration::from_secs(2))).await {
if let Ok(events) =
client.get_events_of(vec![filter], EventSource::relays(Some(Duration::from_secs(3)))).await
{
if let Some(event) = events.first() {
for (url, ..) in nip65::extract_relay_list(event) {
let _ = client.add_relay(url).await;
@@ -68,7 +70,8 @@ pub async fn collect_inbox_relays(
let public_key = PublicKey::parse(user_id).map_err(|e| e.to_string())?;
let inbox = Filter::new().kind(Kind::Custom(10050)).author(public_key).limit(1);
match client.get_events_of(vec![inbox], Some(Duration::from_secs(2))).await {
match client.get_events_of(vec![inbox], EventSource::relays(Some(Duration::from_secs(3)))).await
{
Ok(events) => {
if let Some(event) = events.into_iter().next() {
let urls = event
@@ -138,7 +141,8 @@ pub async fn connect_inbox_relays(
let inbox = Filter::new().kind(Kind::Custom(10050)).author(public_key).limit(1);
match client.get_events_of(vec![inbox], Some(Duration::from_secs(2))).await {
match client.get_events_of(vec![inbox], EventSource::relays(Some(Duration::from_secs(3)))).await
{
Ok(events) => {
let mut relays = Vec::new();