Skip to content

Commit

Permalink
fix: show self send attachments boxdot#278
Browse files Browse the repository at this point in the history
  • Loading branch information
John Doe committed Mar 22, 2024
1 parent a53da02 commit c798b2a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/signal/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,21 @@ impl SignalManager for PresageManager {
..Default::default()
};

if has_attachments && message.is_empty() {
if has_attachments {
// TODO: Temporary solution until we start rendering attachments
message = format!(
let attachment_message: String = format!(
"<attached: {}>",
attachments
.iter()
.map(|(a, _)| a.file_name.clone().unwrap_or(a.content_type.clone()))
.collect::<Vec<_>>()
.join(", ")
);
if message.is_empty() {
message = attachment_message
} else {
message = message + "\n" + &attachment_message
}
}

let (response_tx, response) = oneshot::channel();
Expand Down

0 comments on commit c798b2a

Please sign in to comment.