Skip to content

Commit

Permalink
Add receipt
Browse files Browse the repository at this point in the history
  • Loading branch information
gferon committed Oct 16, 2024
1 parent 6f3eb06 commit 1a58477
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions presage-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ use presage::libsignal_service::zkgroup::GroupMasterKeyBytes;
use presage::libsignal_service::ServiceAddress;
use presage::libsignal_service::{groups_v2::Group, prelude::ProfileKey};
use presage::manager::ReceivingMode;
use presage::proto::receipt_message;
use presage::proto::EditMessage;
use presage::proto::ReceiptMessage;
use presage::proto::SyncMessage;
use presage::store::ContentExt;
use presage::{
Expand Down Expand Up @@ -422,6 +424,16 @@ fn print_message<S: Store>(
}) => format_data_message(&thread, data_message).map(|body| Msg::Sent(&thread, body)),
ContentBody::CallMessage(_) => Some(Msg::Received(&thread, "is calling!".into())),
ContentBody::TypingMessage(_) => Some(Msg::Received(&thread, "is typing...".into())),
ContentBody::ReceiptMessage(ReceiptMessage {
r#type: receipt_type,
timestamp,
}) => Some(Msg::Received(
&thread,
format!(
"got {:?} receipt for messages sent at {timestamp:?}",
receipt_message::Type::try_from(receipt_type.unwrap_or_default()).unwrap()
),
)),
c => {
log::warn!("unsupported message {c:?}");
None
Expand Down

0 comments on commit 1a58477

Please sign in to comment.