Skip to content

Commit

Permalink
Depend on presage commit 8b9af8e.
Browse files Browse the repository at this point in the history
  • Loading branch information
hoehermann committed Dec 4, 2024
1 parent af7aa74 commit 5f7a554
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ name = "purple_presage_backend"
path = "src/lib.rs"
crate-type = ["staticlib"]

# presage needs this, taken from https://github.com/whisperfish/presage/blob/ff708a1/Cargo.toml
# presage needs this, taken from https://github.com/whisperfish/presage/blob/8b9af8e/Cargo.toml
[patch.crates-io]
curve25519-dalek = { git = 'https://github.com/signalapp/curve25519-dalek', tag = 'signal-curve25519-4.1.3' }

[dependencies]
presage = { git = "https://github.com/whisperfish/presage", rev = "ff708a1" }
presage-store-sled = { git = "https://github.com/whisperfish/presage", rev = "ff708a1" }
presage = { git = "https://github.com/whisperfish/presage", rev = "8b9af8e" }
presage-store-sled = { git = "https://github.com/whisperfish/presage", rev = "8b9af8e" }
mime-sniffer = { git = "https://github.com/kamadorueda/rust-mime-sniffer"}
hex = "*"
chrono = "*"
Expand Down
2 changes: 1 addition & 1 deletion src/rust/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async fn run<C: presage::store::Store + 'static>(
crate::structs::Cmd::Whoami => {
let manager = manager.unwrap_or(presage::Manager::load_registered(config_store).await?);
let whoami = manager.whoami().await?;
let uuid = whoami.uuid.to_string();
let uuid = whoami.aci.to_string(); // TODO: check alternatives to aci
let mut message = crate::bridge::Presage::from_account(account);
message.uuid = std::ffi::CString::new(uuid.to_string()).unwrap().into_raw();
crate::bridge::append_message(&message);
Expand Down
8 changes: 4 additions & 4 deletions src/rust/src/receive.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use futures::StreamExt; // for Stream.next()
use futures::StreamExt;

/**
Looks up the title of a group identified by its group master key.
Expand Down Expand Up @@ -173,8 +173,8 @@ async fn print_message<C: presage::store::Store>(
}
Msg::Received(presage::store::Thread::Group(key), body) => {
message.flags = 0x0002; // PURPLE_MESSAGE_RECV
message.who = std::ffi::CString::new(content.metadata.sender.uuid.to_string()).unwrap().into_raw();
message.name = std::ffi::CString::new(format_contact(&content.metadata.sender.uuid, manager).await).unwrap().into_raw();
message.who = std::ffi::CString::new(content.metadata.sender.raw_uuid().to_string()).unwrap().into_raw();
message.name = std::ffi::CString::new(format_contact(&content.metadata.sender.raw_uuid(), manager).await).unwrap().into_raw();
message.group = std::ffi::CString::new(hex::encode(key)).unwrap().into_raw();
message.title = std::ffi::CString::new(format_group(*key, manager).await).unwrap().into_raw();
message.body = std::ffi::CString::new(body).unwrap().into_raw();
Expand Down Expand Up @@ -217,7 +217,7 @@ async fn process_incoming_message<C: presage::store::Store>(
// TODO: `who` and `group` should be filled with the Receiver (group or contact) information
// so they end up in the correct conversation
// relevant for sync messages in particular
message.who = std::ffi::CString::new(content.metadata.sender.uuid.to_string()).unwrap().into_raw();
message.who = std::ffi::CString::new(content.metadata.sender.raw_uuid().to_string()).unwrap().into_raw();

let Ok(attachment_data) = manager.get_attachment(attachment_pointer).await else {
message.flags = 0x0200; // PURPLE_MESSAGE_ERROR
Expand Down
2 changes: 1 addition & 1 deletion src/rust/src/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub async fn send<C: presage::store::Store + 'static>(
crate::structs::Recipient::Contact(uuid) => {
manager
.send_message(
presage::libsignal_service::ServiceAddress::from_aci(uuid),
presage::libsignal_service::protocol::ServiceId::Aci(uuid.into()),
presage::libsignal_service::content::ContentBody::DataMessage(data_message),
timestamp,
)
Expand Down

0 comments on commit 5f7a554

Please sign in to comment.