diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/client.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/client.rs b/src/lib/client.rs index c5c38cf..3f1f22e 100644 --- a/src/lib/client.rs +++ b/src/lib/client.rs | |||
| @@ -2801,6 +2801,17 @@ fn describe_events(events: &[nostr::Event]) -> String { | |||
| 2801 | } | 2801 | } |
| 2802 | } | 2802 | } |
| 2803 | 2803 | ||
| 2804 | pub async fn delete_event_from_local_cache( | ||
| 2805 | git_repo_path: &Path, | ||
| 2806 | event_id: nostr::EventId, | ||
| 2807 | ) -> Result<()> { | ||
| 2808 | let db = get_local_cache_database(git_repo_path).await?; | ||
| 2809 | db.delete(nostr::Filter::default().id(event_id)) | ||
| 2810 | .await | ||
| 2811 | .map_err(|e| anyhow!("failed to delete event from local cache: {e}"))?; | ||
| 2812 | Ok(()) | ||
| 2813 | } | ||
| 2814 | |||
| 2804 | fn remove_trailing_slash(s: &str) -> String { | 2815 | fn remove_trailing_slash(s: &str) -> String { |
| 2805 | match s.strip_suffix('/') { | 2816 | match s.strip_suffix('/') { |
| 2806 | Some(s) => s, | 2817 | Some(s) => s, |