From eb73c2930e7dcd77ae7ac3fbf7c6d1a4ae1460b1 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Wed, 22 Feb 2023 21:49:11 -0600 Subject: [PATCH] Send EOSE when we receive a subscription --- src/lib.rs | 9 +++++++++ src/nostr.rs | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index f51d972..e3f4398 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -217,6 +217,15 @@ pub async fn main(req: Request, env: Env, _ctx: Context) -> Result { .send_with_str(&relay_msg.as_json()) .expect("failed to send response"); } + ClientMessage::Req { + subscription_id, .. + } => { + console_log!("ignoring nostr subscription request"); + let relay_msg = RelayMessage::new_eose(subscription_id); + server + .send_with_str(&relay_msg.as_json()) + .expect("failed to send response"); + } _ => { console_log!("ignoring other nostr client message types"); } diff --git a/src/nostr.rs b/src/nostr.rs index 7591d12..a1be61b 100644 --- a/src/nostr.rs +++ b/src/nostr.rs @@ -28,7 +28,7 @@ const RELAYS: [&str; 8] = [ pub fn get_nip11_response() -> RelayInformationDocument { let version = env!("CARGO_PKG_VERSION"); - let supported_nips = vec![1, 11, 20]; + let supported_nips = vec![1, 11, 15, 20]; RelayInformationDocument { name: Some("Mutiny blastr relay".to_string()),