Skip to content

Commit

Permalink
FIX: Note rendered as QR to use decrypted content (if encrypted note)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedilger committed Jan 13, 2024
1 parent 0d3f9e6 commit 6b329b1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gossip-bin/src/ui/feed/note/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1077,8 +1077,13 @@ fn render_content(
.text_style(TextStyle::Small),
);
} else if app.render_qr == Some(event.id) {
app.render_qr(ui, ctx, "feedqr", event.content.trim());
// FIXME should this be the unmodified content (event.content)?
if note.event.kind == EventKind::EncryptedDirectMessage {
if let Ok(m) = GLOBALS.signer.decrypt_message(&note.event) {
app.render_qr(ui, ctx, "feedqr", m.trim());
}
} else {
app.render_qr(ui, ctx, "feedqr", event.content.trim());
}
} else if event.content_warning().is_some()
&& !app.approved.contains(&event.id)
&& !app.settings.approve_content_warning
Expand Down

0 comments on commit 6b329b1

Please sign in to comment.