mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 19:46:50 +00:00
Process events that are not text notes immediately
This commit is contained in:
parent
e05b68f05e
commit
e64c85a5ea
@ -2,7 +2,7 @@ use super::Minion;
|
|||||||
use crate::globals::GLOBALS;
|
use crate::globals::GLOBALS;
|
||||||
use crate::Error;
|
use crate::Error;
|
||||||
use futures::SinkExt;
|
use futures::SinkExt;
|
||||||
use nostr_types::{RelayMessage, Unixtime};
|
use nostr_types::{EventKind, RelayMessage, Unixtime};
|
||||||
use tracing::{debug, error, info, warn};
|
use tracing::{debug, error, info, warn};
|
||||||
use tungstenite::protocol::Message as WsMessage;
|
use tungstenite::protocol::Message as WsMessage;
|
||||||
|
|
||||||
@ -32,11 +32,18 @@ impl Minion {
|
|||||||
.unwrap_or_else(|| "_".to_owned());
|
.unwrap_or_else(|| "_".to_owned());
|
||||||
debug!("{}: {}: NEW EVENT", &self.url, handle);
|
debug!("{}: {}: NEW EVENT", &self.url, handle);
|
||||||
|
|
||||||
GLOBALS
|
if event.kind == EventKind::TextNote {
|
||||||
.incoming_events
|
// Just store text notes in incoming
|
||||||
.write()
|
GLOBALS
|
||||||
.await
|
.incoming_events
|
||||||
.push((*event, self.url.clone()));
|
.write()
|
||||||
|
.await
|
||||||
|
.push((*event, self.url.clone()));
|
||||||
|
} else {
|
||||||
|
// Process everything else immediately
|
||||||
|
crate::process::process_new_event(&event, true, Some(self.url.clone()))
|
||||||
|
.await?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RelayMessage::Notice(msg) => {
|
RelayMessage::Notice(msg) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user