fix: subscription event filtering bugs

Subscriptions properly filter using the authors tag.  Petname/keys are
correctly filtered (previously the event tags were incorrectly used).
This commit is contained in:
Greg Heartsfield
2021-12-14 21:38:26 -06:00
parent 54e6e0e5ce
commit 49598b2c9e
4 changed files with 36 additions and 16 deletions
+5
View File
@@ -154,6 +154,11 @@ impl Event {
pub fn event_tag_match(&self, eventid: &str) -> bool {
self.get_event_tags().contains(&eventid)
}
/// Check if a given event is referenced in an event tag.
pub fn pubkey_tag_match(&self, pubkey: &str) -> bool {
self.get_pubkey_tags().contains(&pubkey)
}
}
#[cfg(test)]