melib/ui: small fixes
- melib/imap: accept quoted strings with escaped quotes in protocol_parser - ui/accounts: return unavailabity correctly if folder's worker slot is empty instead of judging only by its vacancy - ui/MailView: set view as not dirty if envelope loading from backend fails so that it stops requesting it in every subsequent redrawasync
parent
6f76cd9acc
commit
f05a4205f7
|
@ -815,8 +815,7 @@ pub fn quoted(input: &[u8]) -> IResult<&[u8], Vec<u8>> {
|
||||||
|
|
||||||
let mut i = 1;
|
let mut i = 1;
|
||||||
while i < input.len() {
|
while i < input.len() {
|
||||||
if input[i] == b'\"' {
|
if input[i] == b'\"' && (i == 0 || (input[i - 1] != b'\\')) {
|
||||||
//&& input[i - 1] != b'\\' {
|
|
||||||
return match crate::email::parser::phrase(&input[1..i]) {
|
return match crate::email::parser::phrase(&input[1..i]) {
|
||||||
IResult::Done(_, out) => IResult::Done(&input[i + 1..], out),
|
IResult::Done(_, out) => IResult::Done(&input[i + 1..], out),
|
||||||
e => e,
|
e => e,
|
||||||
|
|
|
@ -513,6 +513,11 @@ impl Component for MailView {
|
||||||
match envelope.body(op) {
|
match envelope.body(op) {
|
||||||
Ok(body) => body,
|
Ok(body) => body,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
self.dirty = false;
|
||||||
|
clear_area(grid, (set_y(upper_left, y), bottom_right));
|
||||||
|
context
|
||||||
|
.dirty_areas
|
||||||
|
.push_back((set_y(upper_left, y), bottom_right));
|
||||||
context.replies.push_back(UIEvent::Notification(
|
context.replies.push_back(UIEvent::Notification(
|
||||||
Some("Failed to open e-mail".to_string()),
|
Some("Failed to open e-mail".to_string()),
|
||||||
e.to_string(),
|
e.to_string(),
|
||||||
|
|
|
@ -827,7 +827,14 @@ impl Account {
|
||||||
pub fn status(&mut self, folder_hash: FolderHash) -> result::Result<(), usize> {
|
pub fn status(&mut self, folder_hash: FolderHash) -> result::Result<(), usize> {
|
||||||
match self.workers.get_mut(&folder_hash).unwrap() {
|
match self.workers.get_mut(&folder_hash).unwrap() {
|
||||||
None => {
|
None => {
|
||||||
return Ok(());
|
return if self.folders[&folder_hash].is_available()
|
||||||
|
|| (self.folders[&folder_hash].is_parsing()
|
||||||
|
&& self.collection.threads.contains_key(&folder_hash))
|
||||||
|
{
|
||||||
|
Ok(())
|
||||||
|
} else {
|
||||||
|
Err(0)
|
||||||
|
};
|
||||||
}
|
}
|
||||||
Some(ref mut w) => match w.poll() {
|
Some(ref mut w) => match w.poll() {
|
||||||
Ok(AsyncStatus::NoUpdate) => {
|
Ok(AsyncStatus::NoUpdate) => {
|
||||||
|
|
Loading…
Reference in New Issue