From 15a07e589201a3c748835747760a1b41e054ccc0 Mon Sep 17 00:00:00 2001 From: Moritz Poldrack Date: Wed, 22 Jun 2022 12:19:38 +0200 Subject: [PATCH] pgp: add note for encrypted messages that are not signed Since there is a prominent checkmark for encrypted messages, it might not be entirely clear that the contents have not been signed. Signed-off-by: Moritz Poldrack Tested-by: Tim Culverhouse --- widgets/pgpinfo.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/widgets/pgpinfo.go b/widgets/pgpinfo.go index 8dc0570..05e2053 100644 --- a/widgets/pgpinfo.go +++ b/widgets/pgpinfo.go @@ -44,12 +44,17 @@ func (p *PGPInfo) DrawSignature(ctx *ui.Context) { } func (p *PGPInfo) DrawEncryption(ctx *ui.Context, y int) { + warningStyle := p.uiConfig.GetStyle(config.STYLE_WARNING) validStyle := p.uiConfig.GetStyle(config.STYLE_SUCCESS) defaultStyle := p.uiConfig.GetStyle(config.STYLE_DEFAULT) x := ctx.Printf(0, y, validStyle, "✓ Encrypted ") x += ctx.Printf(x, y, defaultStyle, "To %s (%8X) ", p.details.DecryptedWith, p.details.DecryptedWithKeyId) + if !p.details.IsSigned { + x += ctx.Printf(x, y, warningStyle, + "(message not signed!)") + } } func (p *PGPInfo) Draw(ctx *ui.Context) {