stash: blocking persistent entries by window class

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a6964061bd97b4ffc4e84d835072331a966c6
This commit is contained in:
raf 2025-09-19 11:18:57 +03:00
commit 36c183742d
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
7 changed files with 483 additions and 19 deletions

View file

@ -9,6 +9,7 @@ pub trait StoreCommand {
max_dedupe_search: u64,
max_items: u64,
state: Option<String>,
excluded_apps: &[String],
) -> Result<(), crate::db::StashError>;
}
@ -19,12 +20,18 @@ impl StoreCommand for SqliteClipboardDb {
max_dedupe_search: u64,
max_items: u64,
state: Option<String>,
excluded_apps: &[String],
) -> Result<(), crate::db::StashError> {
if let Some("sensitive" | "clear") = state.as_deref() {
self.delete_last()?;
log::info!("Entry deleted");
} else {
self.store_entry(input, max_dedupe_search, max_items)?;
self.store_entry(
input,
max_dedupe_search,
max_items,
Some(excluded_apps),
)?;
log::info!("Entry stored");
}
Ok(())