git.lucas.co / cce-mail
mail client (IMAP/SMTP)
git clone https://git.lucas.co/cce-mail.git

commitf95555bab76816b60cbd03dd4d1780a15627be3c
parentb743ca5eae
authorLucas Galante <lsgalante12@gmail.com>
date2026-10-02 14:47
refactor(wpe): the content-filter store dir from cce_ui::config::cce_state_dir

Same path, `<state_home>/cce/mail/content-filters`, and the same rules
(this copy already ignored a relative $XDG_STATE_HOME); the lookup is
cce-ui's now (f31c86b). Still disabled when there is no home to put it in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

 src/wpe/host.rs | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/wpe/host.rs b/src/wpe/host.rs
index 876fc83..cfd7c03 100644
--- a/src/wpe/host.rs
+++ b/src/wpe/host.rs
@@ -661,11 +661,8 @@ unsafe fn compile_block_filter() -> *mut WebKitUserContentFilter {
         slot.done.set(true);
     }
 
-    let dir = std::env::var_os("XDG_STATE_HOME")
-        .map(std::path::PathBuf::from)
-        .filter(|p| p.is_absolute())
-        .or_else(|| std::env::var_os("HOME").map(|h| std::path::PathBuf::from(h).join(".local/state")))
-        .map(|p| p.join("cce/mail/content-filters"));
+    // Absolute unless neither $XDG_STATE_HOME nor $HOME is set.
+    let dir = Some(cce_ui::config::cce_state_dir().join("mail/content-filters")).filter(|d| d.is_absolute());
     let Some(dir) = dir else {
         eprintln!("cce-mail: no HOME; remote-content filter disabled");
         return std::ptr::null_mut();