melib/imap: FETCH comma-sep list on untagged Recent response

FETCHing RECENT messages when receiving an untagged RECENT response from
the server didn't separate the message numbers with comma but with
space, which is invalid.
pull/144/head
Manos Pitsidianakis 4 years ago
parent 9bafba3905
commit 3004789f32
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710

@ -241,12 +241,18 @@ impl ImapConnection {
debug!("UID SEARCH RECENT returned no results");
}
Ok(v) => {
let command = {
let mut iter = v.split(u8::is_ascii_whitespace);
let first = iter.next().unwrap_or(v);
let mut accum = format!("{}", to_str!(first).trim());
for ms in iter {
accum = format!("{},{}", accum, to_str!(ms).trim());
}
format!("UID FETCH {} (FLAGS RFC822)", accum)
};
try_fail!(
mailbox_hash,
self.send_command(
&[b"UID FETCH", v, b"(FLAGS RFC822)"]
.join(&b' '),
).await
self.send_command(command.as_bytes()).await
self.read_response(&mut response, RequiredResponses::FETCH_REQUIRED).await
);
debug!(&response);

Loading…
Cancel
Save