Skip to content

Commit

Permalink
feat: upgrade libsignal-service incl. message editing (whisperfish#260)
Browse files Browse the repository at this point in the history
also reduce the stack size of the error enum
  • Loading branch information
boxdot authored Jul 29, 2024
1 parent ceb9017 commit 67d98a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions presage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ edition = "2021"
license = "AGPL-3.0-only"

[dependencies]
libsignal-service = { git = "https://github.com/whisperfish/libsignal-service-rs", rev = "1b591540b908112816be131d6baa6eafba2129cb" }
libsignal-service-hyper = { git = "https://github.com/whisperfish/libsignal-service-rs", rev = "1b591540b908112816be131d6baa6eafba2129cb" }
libsignal-service = { git = "https://github.com/whisperfish/libsignal-service-rs", rev = "86dd9da99b254c2127fb60c366df426d60318097" }
libsignal-service-hyper = { git = "https://github.com/whisperfish/libsignal-service-rs", rev = "86dd9da99b254c2127fb60c366df426d60318097" }

base64 = "0.21"
futures = "0.3"
Expand Down
9 changes: 8 additions & 1 deletion presage/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::borrow::Cow;

use libsignal_service::prelude::MessageSenderError;
use libsignal_service::{
models::ParseContactError, protocol::SignalProtocolError, ParseServiceAddressError,
};
Expand Down Expand Up @@ -31,7 +32,7 @@ pub enum Error<S: std::error::Error> {
#[error("libsignal-service error: {0}")]
ProfileManagerError(#[from] libsignal_service::ProfileManagerError),
#[error("libsignal-service sending error: {0}")]
MessageSenderError(#[from] libsignal_service::prelude::MessageSenderError),
MessageSenderError(Box<MessageSenderError>),
#[error("this client is already registered with Signal")]
AlreadyRegisteredError,
#[error("this client is not yet registered, please register or link as a secondary device")]
Expand Down Expand Up @@ -76,6 +77,12 @@ pub enum Error<S: std::error::Error> {
NotPrimaryDevice,
}

impl<S: std::error::Error> From<MessageSenderError> for Error<S> {
fn from(v: MessageSenderError) -> Self {
Self::MessageSenderError(Box::new(v))
}
}

impl<S: StoreError> From<S> for Error<S> {
fn from(e: S) -> Self {
Self::Store(e)
Expand Down

0 comments on commit 67d98a3

Please sign in to comment.