Skip to content

Commit b6fabff

Browse files
authored
Temporary disable event filter before processing (#387)
* Temporary disable event filter before processing * Merged
1 parent 901de69 commit b6fabff

File tree

1 file changed

+6
-6
lines changed
  • src/service/notification_service

1 file changed

+6
-6
lines changed

src/service/notification_service/nostr.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl NostrConsumer {
162162
// move dependencies into thread scope
163163
let client = self.client.clone();
164164
let event_handlers = self.event_handlers.clone();
165-
let contact_service = self.contact_service.clone();
165+
let _contact_service = self.contact_service.clone();
166166
let offset_store = self.offset_store.clone();
167167

168168
// continue where we left off
@@ -194,10 +194,10 @@ impl NostrConsumer {
194194
let sender_node_id = sender.to_hex();
195195
trace!("Received event: {envelope:?} from {sender_npub:?} (hex: {sender_node_id})");
196196
// We use hex here, so we can compare it with our node_ids
197-
if contact_service.is_known_npub(&sender_node_id).await? {
198-
trace!("Received event: {envelope:?} from {sender_node_id:?} (hex: {sender_node_id})");
197+
// TODO: re-enable after presentation: if contact_service.is_known_npub(&sender_node_id).await? {
198+
trace!("Processing event: {envelope:?}");
199199
handle_event(envelope, &node_id, &event_handlers).await?;
200-
}
200+
// }
201201
}
202202

203203
// store the new event offset
@@ -256,14 +256,14 @@ fn extract_event_envelope(rumor: UnsignedEvent) -> Option<EventEnvelope> {
256256
/// Handle extracted event with given handlers.
257257
async fn handle_event(
258258
event: EventEnvelope,
259-
identity: &str,
259+
node_id: &str,
260260
handlers: &Arc<Vec<Box<dyn NotificationHandlerApi>>>,
261261
) -> Result<()> {
262262
let event_type = &event.event_type;
263263
let mut times = 0;
264264
for handler in handlers.iter() {
265265
if handler.handles_event(event_type) {
266-
match handler.handle_event(event.to_owned(), identity).await {
266+
match handler.handle_event(event.to_owned(), node_id).await {
267267
Ok(_) => times += 1,
268268
Err(e) => error!("Nostr event handler failed: {e}"),
269269
}

0 commit comments

Comments
 (0)