fix: prevent deletion of deletion events

This commit is contained in:
Greg Heartsfield 2022-10-08 08:02:16 -05:00
parent a4df9445b6
commit 8a63d88b0b

View File

@ -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)?;