mirror of
https://github.com/aljazceru/blastr.git
synced 2025-12-17 22:14:20 +01:00
Response to Tony's review
This commit is contained in:
@@ -14,6 +14,7 @@ cfg-if = "0.1.2"
|
|||||||
# Need the queue feature
|
# Need the queue feature
|
||||||
worker = { git = "https://github.com/cloudflare/workers-rs", rev = "b4b9cd1f15feac412b6f9e9e9209458cd3b98430", features = ["queue"] }
|
worker = { git = "https://github.com/cloudflare/workers-rs", rev = "b4b9cd1f15feac412b6f9e9e9209458cd3b98430", features = ["queue"] }
|
||||||
futures = "0.3.26"
|
futures = "0.3.26"
|
||||||
|
# Needed for serde serializaters
|
||||||
nostr = { git = "https://github.com/benthecarman/nostr", rev = "6c238ac72651671bcfd6666ddcd731767d1643b8" }
|
nostr = { git = "https://github.com/benthecarman/nostr", rev = "6c238ac72651671bcfd6666ddcd731767d1643b8" }
|
||||||
serde = { version = "^1.0", features = ["derive"] }
|
serde = { version = "^1.0", features = ["derive"] }
|
||||||
|
|
||||||
|
|||||||
18
src/lib.rs
18
src/lib.rs
@@ -191,27 +191,19 @@ pub async fn main(req: Request, env: Env, _ctx: Context) -> Result<Response> {
|
|||||||
{
|
{
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
console_log!("saved published note: {}", event.id);
|
console_log!("saved published note: {}", event.id);
|
||||||
let relay_msg =
|
|
||||||
RelayMessage::new_ok(event.id, true, "");
|
|
||||||
server
|
|
||||||
.send_with_str(&relay_msg.as_json())
|
|
||||||
.expect("failed to send response");
|
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
console_log!(
|
console_log!(
|
||||||
"could not save published note: {} - {e:?}",
|
"could not save published note: {} - {e:?}",
|
||||||
event.id
|
event.id
|
||||||
);
|
);
|
||||||
let relay_msg = RelayMessage::new_ok(
|
|
||||||
event.id,
|
|
||||||
false,
|
|
||||||
"error: could not save published note",
|
|
||||||
);
|
|
||||||
server
|
|
||||||
.send_with_str(&relay_msg.as_json())
|
|
||||||
.expect("failed to send response");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let relay_msg = RelayMessage::new_ok(event.id, true, "");
|
||||||
|
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");
|
||||||
|
|||||||
Reference in New Issue
Block a user