From 8a63d88b0b60c5c44f64d622d6151c98f3e7e11d Mon Sep 17 00:00:00 2001 From: Greg Heartsfield Date: Sat, 8 Oct 2022 08:02:16 -0500 Subject: [PATCH] fix: prevent deletion of deletion events --- src/db.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db.rs b/src/db.rs index a861de1..eb05de9 100644 --- a/src/db.rs +++ b/src/db.rs @@ -353,7 +353,7 @@ pub fn write_event(conn: &mut PooledConnection, e: &Event) -> Result { .filter_map(|x| hex::decode(x).ok()) .for_each(|x| params.push(Box::new(x))); let query = format!( - "UPDATE event SET hidden=TRUE WHERE author=? AND event_hash IN ({})", + "UPDATE event SET hidden=TRUE WHERE kind!=5 AND author=? AND event_hash IN ({})", repeat_vars(params.len() - 1) ); let mut stmt = tx.prepare(&query)?;