melib/imap: fix deflate feature flags

memfd
Manos Pitsidianakis 2020-08-25 21:34:22 +03:00
parent f7ac1703e8
commit 96a3da3d7b
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
2 changed files with 10 additions and 4 deletions

View File

@ -242,7 +242,8 @@ impl MailBackend for ImapType {
} }
} }
"COMPRESS=DEFLATE" => { "COMPRESS=DEFLATE" => {
if cfg!(feature = "deflate_compression") { #[cfg(feature = "deflate_compression")]
{
if deflate { if deflate {
*status = MailBackendExtensionStatus::Enabled { comment: None }; *status = MailBackendExtensionStatus::Enabled { comment: None };
} else { } else {
@ -250,7 +251,9 @@ impl MailBackend for ImapType {
comment: Some("Disabled by user configuration"), comment: Some("Disabled by user configuration"),
}; };
} }
} else { }
#[cfg(not(feature = "deflate_compression"))]
{
*status = MailBackendExtensionStatus::Unsupported { *status = MailBackendExtensionStatus::Unsupported {
comment: Some("melib not compiled with DEFLATE."), comment: Some("melib not compiled with DEFLATE."),
}; };

View File

@ -151,7 +151,8 @@ impl MailBackend for NntpType {
for (name, status) in extensions.iter_mut() { for (name, status) in extensions.iter_mut() {
match name.as_str() { match name.as_str() {
"COMPRESS DEFLATE" => { "COMPRESS DEFLATE" => {
if cfg!(feature = "deflate_compression") { #[cfg(feature = "deflate_compression")]
{
if deflate { if deflate {
*status = MailBackendExtensionStatus::Enabled { comment: None }; *status = MailBackendExtensionStatus::Enabled { comment: None };
} else { } else {
@ -159,7 +160,9 @@ impl MailBackend for NntpType {
comment: Some("Disabled by user configuration"), comment: Some("Disabled by user configuration"),
}; };
} }
} else { }
#[cfg(not(feature = "deflate_compression"))]
{
*status = MailBackendExtensionStatus::Unsupported { *status = MailBackendExtensionStatus::Unsupported {
comment: Some("melib not compiled with DEFLATE."), comment: Some("melib not compiled with DEFLATE."),
}; };