mirror of
https://github.com/signalapp/libsignal.git
synced 2026-04-26 01:35:22 +02:00
Add proper parse logic for the SSv2 SentMessage format
This isn't hooked up to anything that the fan_out test method wasn't, but it will come in handy for future testing.
This commit is contained in:
@@ -196,6 +196,16 @@ pub fn initialize_sessions_v4() -> Result<(SessionRecord, SessionRecord), Signal
|
||||
Ok((alice_session, bob_session))
|
||||
}
|
||||
|
||||
pub fn extract_single_ssv2_received_message(input: &[u8]) -> (ServiceId, Vec<u8>) {
|
||||
let message = SealedSenderV2SentMessage::parse(input).expect("valid");
|
||||
assert_eq!(1, message.recipients.len());
|
||||
let result = message
|
||||
.received_message_parts_for_recipient(&message.recipients[0])
|
||||
.as_ref()
|
||||
.concat();
|
||||
(message.recipients[0].service_id, result)
|
||||
}
|
||||
|
||||
pub enum IdChoice {
|
||||
Exactly(u32),
|
||||
Next,
|
||||
|
||||
Reference in New Issue
Block a user