only process nip17 rumor

This commit is contained in:
Ren Amamiya
2026-04-10 09:32:04 +07:00
parent c239e351b8
commit 6f0cefed33
2 changed files with 11 additions and 0 deletions

View File

@@ -253,6 +253,13 @@ impl ChatRegistry {
event_map.insert(rumor.id.unwrap(), (event.id, dekey));
}
if rumor.kind != Kind::PrivateDirectMessage
|| rumor.kind != Kind::Custom(15)
{
log::info!("Rumor is not releated to NIP17");
continue;
}
// Check if the rumor has a recipient
if rumor.tags.is_empty() {
let signal =

View File

@@ -400,6 +400,10 @@ impl Room {
.await?
.into_iter()
.filter_map(|event| UnsignedEvent::from_json(&event.content).ok())
.filter(|event| {
// Filter out private direct messages and file messages
event.kind != Kind::PrivateDirectMessage && event.kind != Kind::Custom(15)
})
.sorted_by_key(|message| message.created_at)
.collect();