aboutsummaryrefslogtreecommitdiffstats
path: root/src/ops.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ops.rs')
-rw-r--r--src/ops.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ops.rs b/src/ops.rs
index 45fb919..f45b9ab 100644
--- a/src/ops.rs
+++ b/src/ops.rs
@@ -151,13 +151,17 @@ pub fn get_paste(
}
/// Delete a paste from local store and the DHT.
+/// Creates a block marker so the paste is not
+/// re-imported from the DHT by sync.
pub fn delete_paste(
node: &mut Node,
store: &PasteStore,
key_str: &str,
) -> Result<(), PasteError> {
let hash = parse_hash(key_str)?;
+ store.block(&hash);
store.remove_paste(&hash);
+ store.unpin(&hash).ok();
node.delete(&hash);
let hash_b58 = key_str.split_once('#').map(|(h, _)| h).unwrap_or(key_str);
log::info!("del: removed paste {hash_b58}");