Don't require moderation on reactions

This commit is contained in:
Mike Dilger 2024-10-05 11:41:09 +13:00
parent 8acec44808
commit f06073278c

View File

@ -18,6 +18,17 @@ fn main() -> Result<(), Error> {
chorus::setup_logging(&config);
// These kinds don't need approval:
let allowed_kinds = vec![
Kind::from(4), // Encrypted Direct Message
Kind::from(1059), // Giftwrap
Kind::from(10002), // Relay list
Kind::from(10050), // DM Relay list
Kind::from(0), // Metadata
Kind::from(3), // Following list
Kind::from(7), // Reaction
];
let store = chorus::setup_store(&config)?;
let mut buffer: [u8; 128] = [0; 128];
@ -37,13 +48,7 @@ fn main() -> Result<(), Error> {
let mut input = String::new();
'eventloop: for event in events.drain(..) {
// Skip DMs which don't need approval
if event.kind() == Kind::from(4) || event.kind() == Kind::from(1059) {
continue;
}
// Skip relay lists which don't need approval
if event.kind() == Kind::from(10002) {
if allowed_kinds.contains(&event.kind()) {
continue;
}
@ -52,11 +57,6 @@ fn main() -> Result<(), Error> {
continue;
}
// Skip config data
if event.kind() == Kind::from(3) || event.kind() == Kind::from(0) {
continue;
}
// Skip if the author is authorized user
if config.user_keys.contains(&event.pubkey()) {
continue;