Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the Rust version of libsignal-protocol #15

Merged
merged 10 commits into from
Apr 30, 2021
Merged
11 changes: 8 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ authors = ["Gabriel Féron <[email protected]>"]
edition = "2018"

[dependencies]
libsignal-protocol = { git = "https://github.com/Michael-F-Bryan/libsignal-protocol-rs.git" }
libsignal-service = { git = "https://github.com/Michael-F-Bryan/libsignal-service-rs" }
libsignal-service-hyper = { git = "https://github.com/Michael-F-Bryan/libsignal-service-rs.git" }
libsignal-service = { git = "https://github.com/Michael-F-Bryan/libsignal-service-rs", branch = "libsignal-client" }
libsignal-service-hyper = { git = "https://github.com/Michael-F-Bryan/libsignal-service-rs.git", branch = "libsignal-client" }
env_logger = "0.7"
directories = "3.0"
structopt = "0.3"
Expand All @@ -27,9 +26,15 @@ sled = "*"
prost = "*"
hex = "0.4.2"
tokio = { version = "1.0", features = [ "macros", "rt-multi-thread" ] }
async-trait = "0.1"

[dev-dependencies]
quickcheck = "1.0.3"
quickcheck_async = "*"

#[patch."https://github.com/Michael-F-Bryan/libsignal-service-rs.git"]
#libsignal-service = { path = "../libsignal-service-rs/libsignal-service" }
#libsignal-service-hyper = { path = "../libsignal-service-rs/libsignal-service-hyper" }

[features]
quirks = []
12 changes: 8 additions & 4 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
use libsignal_protocol::Context;
use libsignal_service::prelude::protocol::{
IdentityKeyStore, PreKeyStore, SessionStoreExt, SignedPreKeyStore,
};

use crate::{manager::State, Error};

mod sled;
pub use crate::config::sled::SledConfigStore;
pub use self::sled::SledConfigStore;

pub trait ConfigStore {
fn state(&self, context: &Context) -> Result<State, Error>;
pub trait ConfigStore:
PreKeyStore + SignedPreKeyStore + SessionStoreExt + IdentityKeyStore + Clone
{
fn state(&self) -> Result<State, Error>;

fn save(&self, state: &State) -> Result<(), Error>;

Expand Down
Loading