imap: use ImapLineIterator in imap_mailboxes()
parent
e49c293b01
commit
350c8033b1
|
@ -919,10 +919,10 @@ impl ImapType {
|
|||
.read_response(&mut res, RequiredResponses::LIST_REQUIRED)
|
||||
.await?;
|
||||
debug!("out: {}", &res);
|
||||
let mut lines = res.lines();
|
||||
let mut lines = res.split_rn();
|
||||
/* Remove "M__ OK .." line */
|
||||
lines.next_back();
|
||||
for l in lines.map(|l| l.trim()) {
|
||||
for l in lines {
|
||||
if let Ok(mut mailbox) =
|
||||
protocol_parser::list_mailbox_result(l.as_bytes()).map(|(_, v)| v)
|
||||
{
|
||||
|
@ -959,11 +959,11 @@ impl ImapType {
|
|||
conn.send_command(b"LSUB \"\" \"*\"").await?;
|
||||
conn.read_response(&mut res, RequiredResponses::LSUB_REQUIRED)
|
||||
.await?;
|
||||
let mut lines = res.lines();
|
||||
let mut lines = res.split_rn();
|
||||
debug!("out: {}", &res);
|
||||
/* Remove "M__ OK .." line */
|
||||
lines.next_back();
|
||||
for l in lines.map(|l| l.trim()) {
|
||||
for l in lines {
|
||||
if let Ok(subscription) =
|
||||
protocol_parser::list_mailbox_result(l.as_bytes()).map(|(_, v)| v)
|
||||
{
|
||||
|
|
|
@ -392,6 +392,7 @@ pub fn list_mailbox_result(input: &[u8]) -> IResult<&[u8], ImapMailbox> {
|
|||
let (input, separator) = delimited(tag(b"\""), take(1_u32), tag(b"\""))(input)?;
|
||||
let (input, _) = take(1_u32)(input)?;
|
||||
let (input, path) = mailbox_token(input)?;
|
||||
let (input, _) = tag("\r\n")(input)?;
|
||||
Ok((
|
||||
input,
|
||||
({
|
||||
|
@ -1565,5 +1566,5 @@ fn string_token(input: &[u8]) -> IResult<&[u8], &[u8]> {
|
|||
// atom-specials = "(" / ")" / "{" / SP / CTL / list-wildcards / quoted-specials / resp-specials
|
||||
fn astring_char_tokens(input: &[u8]) -> IResult<&[u8], &[u8]> {
|
||||
// FIXME
|
||||
is_not(" ")(input)
|
||||
is_not(" \r\n")(input)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue