Send EOSE when we receive a subscription

This commit is contained in:
benthecarman
2023-02-22 21:49:11 -06:00
parent 1a37dca6ff
commit eb73c2930e
2 changed files with 10 additions and 1 deletions

View File

@@ -217,6 +217,15 @@ pub async fn main(req: Request, env: Env, _ctx: Context) -> Result<Response> {
.send_with_str(&relay_msg.as_json()) .send_with_str(&relay_msg.as_json())
.expect("failed to send response"); .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"); console_log!("ignoring other nostr client message types");
} }

View File

@@ -28,7 +28,7 @@ const RELAYS: [&str; 8] = [
pub fn get_nip11_response() -> RelayInformationDocument { pub fn get_nip11_response() -> RelayInformationDocument {
let version = env!("CARGO_PKG_VERSION"); let version = env!("CARGO_PKG_VERSION");
let supported_nips = vec![1, 11, 20]; let supported_nips = vec![1, 11, 15, 20];
RelayInformationDocument { RelayInformationDocument {
name: Some("Mutiny blastr relay".to_string()), name: Some("Mutiny blastr relay".to_string()),