Skip to content

Commit

Permalink
feat(homeserver): add delete events when deleting and item
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuhvi committed Aug 20, 2024
1 parent b4c7fda commit 51e2625
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pubky-homeserver/src/database/tables/entries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ impl DB {

let deleted_entry = self.tables.entries.delete(&mut wtxn, &key)?;

// create DELETE event
if path.starts_with("pub/") {
let url = format!("pubky://{key}");

let event = Event::put(&url);
let value = event.serialize();

let key = entry.timestamp.to_string();

self.tables.events.put(&mut wtxn, &key, &value)?;

// TODO: delete older events.
// TODO: move to events.rs
}

deleted_entry & deleted_blobs
} else {
false
Expand Down

0 comments on commit 51e2625

Please sign in to comment.