Merge branch 'fix-unlink' into 'master'

Fix unlinking the device, and the store not being encrypted

See merge request schmiddi-on-mobile/flare!186
This commit is contained in:
Julian Schmidhuber committed 2025-11-30 13:32:29 +00:00
commit 3c49ea97be
5 files changed
+430 -491

No files matched your search

+5
View File
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### HOTFIX
- Fixed unlinking the device not working.
- Fixed the store not actually being encrypted.
## [0.17.3] - 2025-11-12
### HOTFIX
Generated
+393 -450
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -24,8 +24,8 @@ tokio = { version = "1.44.0", features = ["rt", "macros", "rt-multi-thread", "ti
regex = "1.11.1"
lazy_static = "1.5.0"
presage = { git = "https://github.com/whisperfish/presage.git", rev = "559591c0e5886f101d3c25c27d8010214e9ea0c3" }
presage-store-sqlite = { git = "https://github.com/whisperfish/presage.git", rev = "559591c0e5886f101d3c25c27d8010214e9ea0c3" }
presage = { git = "https://github.com/whisperfish/presage.git", rev = "282487199cd6a28c96841270c3cbfa4c49358288" }
presage-store-sqlite = { git = "https://github.com/whisperfish/presage.git", rev = "282487199cd6a28c96841270c3cbfa4c49358288" }
libsignal-service = { git = "https://github.com/whisperfish/libsignal-service-rs.git", rev = "0a3bea3fb81599590bf3a54dc00f0a93f36f56e6" }
oo7 = { version = "0.4.1", default-features = false, features = ["native_crypto", "tokio"] }
+9 -18
View File
@@ -154,6 +154,15 @@ impl Manager {
Ok(())
}
pub async fn clear_contents(&self) -> Result<(), ApplicationError> {
log::trace!("Clearing the manager content");
let mut store = self.store();
tspawn!(async move { store.clear_contents().await })
.await
.expect("Failed to spawn tokio")?;
Ok(())
}
pub async fn clear_messages(&self) -> Result<(), ApplicationError> {
log::trace!("Clearing messages from the manager");
let mut store = self.store();
@@ -163,24 +172,6 @@ impl Manager {
Ok(())
}
pub async fn clear_contacts(&self) -> Result<(), ApplicationError> {
log::trace!("Clearing contacts from the manager");
let mut store = self.store();
tspawn!(async move { store.clear_contacts().await })
.await
.expect("Failed to spawn tokio")?;
Ok(())
}
pub async fn clear_groups(&self) -> Result<(), ApplicationError> {
log::trace!("Clearing groups from the manager");
let mut store = self.store();
tspawn!(async move { store.clear_groups().await })
.await
.expect("Failed to spawn tokio")?;
Ok(())
}
pub async fn clear_channel_messages(&self, channel: &Channel) -> Result<(), ApplicationError> {
crate::trace!(
"Clearing channel messages the manager for: {}",
+21 -21
View File
@@ -213,40 +213,40 @@ pub mod imp {
if let Some(man) = obj.imp().manager.borrow().as_ref() {
gspawn!(clone!(
#[strong]
man,
async move {
if let Err(e) = man.clear_registration().await {
log::error!("Failed to clear db: {}", e);
}
}
));
}
log::trace!("Closing the window after unlink");
obj.kill();
} else if response == "unlink-delete" {
log::info!("Unlinking device");
if let Some(man) = obj.imp().manager.borrow().as_ref() {
gspawn!(clone!(
obj,
#[strong]
man,
async move {
if let Err(e) = man.clear_registration().await {
log::error!("Failed to clear db: {}", e);
}
if let Err(e) = man.clear_contacts().await {
log::trace!("Closing the window after unlink");
obj.kill();
}
));
}
} else if response == "unlink-delete" {
log::info!("Unlinking device");
if let Some(man) = obj.imp().manager.borrow().as_ref() {
gspawn!(clone!(
#[strong]
obj,
#[strong]
man,
async move {
if let Err(e) = man.clear_registration().await {
log::error!("Failed to clear db: {}", e);
}
if let Err(e) = man.clear_groups().await {
if let Err(e) = man.clear_contents().await {
log::error!("Failed to clear db: {}", e);
}
if let Err(e) = man.clear_messages().await {
log::error!("Failed to clear db: {}", e);
}
log::trace!("Closing the window after unlink");
obj.kill();
}
));
}
log::trace!("Closing the window after unlink");
obj.kill();
}
}
),