diff options
Diffstat (limited to 'src/sync/relay_connection.rs')
| -rw-r--r-- | src/sync/relay_connection.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sync/relay_connection.rs b/src/sync/relay_connection.rs index 37094be..5a61777 100644 --- a/src/sync/relay_connection.rs +++ b/src/sync/relay_connection.rs | |||
| @@ -23,8 +23,8 @@ use crate::nostr::builder::SharedDatabase; | |||
| 23 | /// Events from a relay connection | 23 | /// Events from a relay connection |
| 24 | #[derive(Debug)] | 24 | #[derive(Debug)] |
| 25 | pub enum RelayEvent { | 25 | pub enum RelayEvent { |
| 26 | /// A new event was received | 26 | /// A new event was received (event, subscription_id) |
| 27 | Event(Event), | 27 | Event(Event, SubscriptionId), |
| 28 | /// End of stored events for a subscription | 28 | /// End of stored events for a subscription |
| 29 | EndOfStoredEvents(SubscriptionId), | 29 | EndOfStoredEvents(SubscriptionId), |
| 30 | /// Connection was closed | 30 | /// Connection was closed |
| @@ -216,7 +216,7 @@ impl RelayConnection { | |||
| 216 | sub_id = %subscription_id, | 216 | sub_id = %subscription_id, |
| 217 | "Received event" | 217 | "Received event" |
| 218 | ); | 218 | ); |
| 219 | if event_sender.send(RelayEvent::Event(*event)).await.is_err() { | 219 | if event_sender.send(RelayEvent::Event(*event, subscription_id.clone())).await.is_err() { |
| 220 | tracing::debug!(relay = %url, "Event sender closed, stopping event loop"); | 220 | tracing::debug!(relay = %url, "Event sender closed, stopping event loop"); |
| 221 | break; | 221 | break; |
| 222 | } | 222 | } |