commit 8a63d88b0b60c5c44f64d622d6151c98f3e7e11d
parent a4df9445b6a94acff9a2b00168637006de4e6163
Author: Greg Heartsfield <scsibug@imap.cc>
Date: Sat, 8 Oct 2022 08:02:16 -0500
fix: prevent deletion of deletion events
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/db.rs b/src/db.rs
@@ -353,7 +353,7 @@ pub fn write_event(conn: &mut PooledConnection, e: &Event) -> Result<usize> {
.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)?;