mirror of
https://github.com/mikedilger/chorus.git
synced 2026-05-03 06:51:42 +00:00
When handling EVENT, advertise to other handlers
This commit is contained in:
parent
fc35600e86
commit
332c8a4903
@ -66,9 +66,11 @@ impl WebSocketService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Store and index the event
|
// Store and index the event
|
||||||
// FIXME: send the event to other listeners in case it matches their subs
|
|
||||||
let reply = match GLOBALS.store.get().unwrap().store_event(&event) {
|
let reply = match GLOBALS.store.get().unwrap().store_event(&event) {
|
||||||
Ok(_) => NostrReply::Ok(event.id(), true, "".to_owned()),
|
Ok(offset) => {
|
||||||
|
GLOBALS.new_events.send(offset)?; // advertise the new event
|
||||||
|
NostrReply::Ok(event.id(), true, "".to_owned())
|
||||||
|
},
|
||||||
Err(Error::Duplicate) => NostrReply::Ok(event.id(), true, "duplicate:".to_owned()),
|
Err(Error::Duplicate) => NostrReply::Ok(event.id(), true, "duplicate:".to_owned()),
|
||||||
Err(e) => NostrReply::Ok(event.id(), false, format!("{e}")),
|
Err(e) => NostrReply::Ok(event.id(), false, format!("{e}")),
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user