Skip to content

Commit

Permalink
Fix wartns
Browse files Browse the repository at this point in the history
  • Loading branch information
gferon committed Oct 24, 2024
1 parent 21a9c78 commit c5fba7b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
1 change: 0 additions & 1 deletion presage-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ license = "AGPL-3.0-only"
[dependencies]
presage = { path = "../presage" }
presage-store-sled = { path = "../presage-store-sled" }
presage-store-sqlite = { path = "../presage-store-sqlite" }

anyhow = { version = "1.0", features = ["backtrace"] }
base64 = "0.22"
Expand Down
11 changes: 8 additions & 3 deletions presage-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use presage::libsignal_service::ServiceAddress;
use presage::manager::ReceivingMode;
use presage::model::contacts::Contact;
use presage::model::groups::Group;
use presage::model::identity::OnNewIdentity;
use presage::proto::receipt_message;
use presage::proto::EditMessage;
use presage::proto::ReceiptMessage;
Expand All @@ -39,9 +40,7 @@ use presage::{
Manager,
};
use presage_store_sled::MigrationConflictStrategy;
use presage_store_sled::OnNewIdentity;
use presage_store_sled::SledStore;
use presage_store_sqlite::SqliteStore;
use tempfile::Builder;
use tokio::task;
use tokio::{
Expand Down Expand Up @@ -225,7 +224,13 @@ async fn main() -> anyhow::Result<()> {
.into()
});
debug!(db_path =% db_path.display(), "opening config database");
let config_store = SqliteStore::open(db_path, OnNewIdentity::Trust).await?;
let config_store = SledStore::open_with_passphrase(
db_path,
args.passphrase,
MigrationConflictStrategy::Raise,
OnNewIdentity::Trust,
)
.await?;
run(args.subcommand, config_store).await
}

Expand Down
2 changes: 1 addition & 1 deletion presage-store-sqlite/src/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::marker::PhantomData;
use presage::{
libsignal_service::{prelude::Content, zkgroup::GroupMasterKeyBytes},
model::{contacts::Contact, groups::Group},
store::{ContentsStore, Sticker, StickerPack},
store::{ContentsStore, StickerPack},
};

use crate::{SqliteStore, SqliteStoreError};
Expand Down
5 changes: 4 additions & 1 deletion presage-store-sqlite/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::path::{Path, PathBuf};
use std::path::Path;

use presage::{
model::identity::OnNewIdentity,
Expand All @@ -7,13 +7,16 @@ use presage::{
use protocol::SqliteProtocolStore;
use sqlx::{sqlite::SqliteConnectOptions, SqlitePool};

#[allow(unused)]
mod content;
mod error;
#[allow(unused)]
mod protocol;

pub use error::SqliteStoreError;

#[derive(Debug, Clone)]
#[allow(unused)]
pub struct SqliteStore {
db: SqlitePool,
/// Whether to trust new identities automatically (for instance, when a somebody's phone has changed)
Expand Down
3 changes: 1 addition & 2 deletions presage-store-sqlite/src/protocol.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::marker::PhantomData;

use async_trait::async_trait;
use chrono::{DateTime, Utc};
use presage::libsignal_service::{
Expand All @@ -18,6 +16,7 @@ use presage::libsignal_service::{
use crate::SqliteStore;

#[derive(Clone)]
#[allow(dead_code)]
pub struct SqliteProtocolStore {
pub(crate) store: SqliteStore,
}
Expand Down

0 comments on commit c5fba7b

Please sign in to comment.