mirror of
https://github.com/mikedilger/chorus.git
synced 2026-05-03 06:51:42 +00:00
Use CLOSED not EOSE if the filter has any ids set
This commit is contained in:
parent
8743bd33df
commit
1568a63110
12
Cargo.lock
generated
12
Cargo.lock
generated
@ -90,9 +90,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
|
||||
|
||||
[[package]]
|
||||
name = "aws-lc-rs"
|
||||
version = "1.12.2"
|
||||
version = "1.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c2b7ddaa2c56a367ad27a094ad8ef4faacf8a617c2575acb2ba88949df999ca"
|
||||
checksum = "3c6a895b664295a4ba0c2c0203c7075ea585dd75cd5c37a8efac829e13e460ef"
|
||||
dependencies = [
|
||||
"aws-lc-sys",
|
||||
"paste",
|
||||
@ -101,9 +101,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "aws-lc-sys"
|
||||
version = "0.25.1"
|
||||
version = "0.26.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "54ac4f13dad353b209b34cbec082338202cbc01c8f00336b55c750c13ac91f8f"
|
||||
checksum = "0f9dd2e03ee80ca2822dd6ea431163d2ef259f2066a4d6ccaca6d9dcb386aa43"
|
||||
dependencies = [
|
||||
"bindgen",
|
||||
"cc",
|
||||
@ -1293,7 +1293,7 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
||||
[[package]]
|
||||
name = "pocket-db"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mikedilger/pocket?branch=master#e6d55e205cc140cc04728960c2ca4e6e906808ef"
|
||||
source = "git+https://github.com/mikedilger/pocket?branch=master#44533cea9f577b2f366d773008b2a8fcde4c00c5"
|
||||
dependencies = [
|
||||
"heed",
|
||||
"libc",
|
||||
@ -1304,7 +1304,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "pocket-types"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mikedilger/pocket?branch=master#e6d55e205cc140cc04728960c2ca4e6e906808ef"
|
||||
source = "git+https://github.com/mikedilger/pocket?branch=master#44533cea9f577b2f366d773008b2a8fcde4c00c5"
|
||||
dependencies = [
|
||||
"derive_more",
|
||||
"secp256k1 0.28.2",
|
||||
|
||||
16
src/nostr.rs
16
src/nostr.rs
@ -146,6 +146,8 @@ impl WebSocketService {
|
||||
}
|
||||
}
|
||||
|
||||
let completes = filters.iter().all(|f| f.completes());
|
||||
|
||||
// NOTE on private events (DMs, GiftWraps)
|
||||
// As seen above, we will send CLOSED auth-required if they ask for DMs and are not
|
||||
// AUTHed yet.
|
||||
@ -200,13 +202,19 @@ impl WebSocketService {
|
||||
self.send(Message::text(reply.as_json())).await?;
|
||||
}
|
||||
|
||||
// eose
|
||||
let reply = NostrReply::Eose(subid);
|
||||
self.send(Message::text(reply.as_json())).await?;
|
||||
if completes {
|
||||
// Closed
|
||||
let reply = NostrReply::Closed(subid, NostrReplyPrefix::None, "".to_owned());
|
||||
self.send(Message::text(reply.as_json())).await?;
|
||||
} else {
|
||||
// EOSE
|
||||
let reply = NostrReply::Eose(subid);
|
||||
self.send(Message::text(reply.as_json())).await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !count {
|
||||
if !count && !completes {
|
||||
// Store subscription
|
||||
self.subscriptions.insert(subid.to_owned(), filters);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user