mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 06:16:30 +03:00
show some text instead of nothing on empty quota list
some providers say that they support QUOTA in the IMAP CAPABILITY, but return an empty list without any quota information then. in our "Connectivity", this looks a bit of an error. i have not seen this error often - only for testrun.org - if it is usual, we could also just say "not supported" (as we do in case QUOTA is not returned). a translations seems not to be needed for now, it seems unusual, and all other errors are not translated as well.
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
- Fix python bindings README documentation on installing the bindings from source.
|
- Fix python bindings README documentation on installing the bindings from source.
|
||||||
|
- Show a warning if quota list is empty #4261
|
||||||
|
|
||||||
## [1.112.5] - 2023-04-02
|
## [1.112.5] - 2023-04-02
|
||||||
|
|
||||||
|
|||||||
@@ -398,7 +398,7 @@ impl Context {
|
|||||||
if let Some(quota) = &*quota {
|
if let Some(quota) = &*quota {
|
||||||
match "a.recent {
|
match "a.recent {
|
||||||
Ok(quota) => {
|
Ok(quota) => {
|
||||||
let roots_cnt = quota.len();
|
if quota.len() > 0 {
|
||||||
for (root_name, resources) in quota {
|
for (root_name, resources) in quota {
|
||||||
use async_imap::types::QuotaResourceName::*;
|
use async_imap::types::QuotaResourceName::*;
|
||||||
for resource in resources {
|
for resource in resources {
|
||||||
@@ -406,11 +406,16 @@ impl Context {
|
|||||||
|
|
||||||
// root name is empty eg. for gmail and redundant eg. for riseup.
|
// root name is empty eg. for gmail and redundant eg. for riseup.
|
||||||
// therefore, use it only if there are really several roots.
|
// therefore, use it only if there are really several roots.
|
||||||
if roots_cnt > 1 && !root_name.is_empty() {
|
if quota.len() > 1 && !root_name.is_empty() {
|
||||||
ret +=
|
ret += &format!(
|
||||||
&format!("<b>{}:</b> ", &*escaper::encode_minimal(root_name));
|
"<b>{}:</b> ",
|
||||||
|
&*escaper::encode_minimal(root_name)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
info!(self, "connectivity: root name hidden: \"{}\"", root_name);
|
info!(
|
||||||
|
self,
|
||||||
|
"connectivity: root name hidden: \"{}\"", root_name
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let messages = stock_str::messages(self).await;
|
let messages = stock_str::messages(self).await;
|
||||||
@@ -457,6 +462,9 @@ impl Context {
|
|||||||
ret += "</li>";
|
ret += "</li>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
ret += format!("<li>Warning: {domain} claims to support quota but gives no information</li>").as_str();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
ret += format!("<li>{e}</li>").as_str();
|
ret += format!("<li>{e}</li>").as_str();
|
||||||
|
|||||||
Reference in New Issue
Block a user