only process nip17 rumor
This commit is contained in:
@@ -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 =
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user