forked from Silverfish/proton-bridge
Bridge 1.5.2 Golden Gate
Release Notes * Improved package creation logic * Refactor of sending functions to simplify code maintenance * Added tests for package creation Fixed * Bridge crashes related to labels handling * GUI popup related to TLS connection error * An issue where a random session key is included in the data payload * Error handling (including improved detection)
This commit is contained in:
@ -191,8 +191,12 @@ func (b *sendPreferencesBuilder) build() (p SendPreferences) {
|
||||
p.Scheme = pmapi.PGPMIMEPackage
|
||||
}
|
||||
|
||||
case b.shouldSign() && !b.shouldEncrypt() && b.getScheme() == pgpMIME:
|
||||
p.Scheme = pmapi.ClearMIMEPackage
|
||||
case b.shouldSign() && !b.shouldEncrypt():
|
||||
if b.getScheme() == pgpInline {
|
||||
p.Scheme = pmapi.ClearPackage
|
||||
} else {
|
||||
p.Scheme = pmapi.ClearMIMEPackage
|
||||
}
|
||||
|
||||
default:
|
||||
p.Scheme = pmapi.ClearPackage
|
||||
|
||||
@ -254,6 +254,20 @@ func TestPreferencesBuilder(t *testing.T) {
|
||||
wantMIMEType: "multipart/mixed",
|
||||
},
|
||||
|
||||
{
|
||||
name: "external with contact sign enabled and plain text",
|
||||
|
||||
contactMeta: &ContactMetadata{MIMEType: "text/plain", Scheme: pgpInline, Sign: true, SignIsSet: true},
|
||||
receivedKeys: []pmapi.PublicKey{},
|
||||
isInternal: false,
|
||||
mailSettings: pmapi.MailSettings{PGPScheme: pmapi.PGPMIMEPackage, DraftMIMEType: "text/html"},
|
||||
|
||||
wantEncrypt: false,
|
||||
wantSign: true,
|
||||
wantScheme: pmapi.ClearPackage,
|
||||
wantMIMEType: "text/plain",
|
||||
},
|
||||
|
||||
{
|
||||
name: "external with sign enabled, sending plaintext, should still send as ClearMIME",
|
||||
|
||||
|
||||
Reference in New Issue
Block a user