mirror of
https://github.com/chatmail/core.git
synced 2026-05-16 21:36:30 +03:00
nicer print of imap capabilities
This commit is contained in:
@@ -7,7 +7,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
|
|||||||
|
|
||||||
use async_imap::{
|
use async_imap::{
|
||||||
error::Result as ImapResult,
|
error::Result as ImapResult,
|
||||||
types::{Fetch, Flag, Mailbox, Name, NameAttribute},
|
types::{Capability, Fetch, Flag, Mailbox, Name, NameAttribute},
|
||||||
};
|
};
|
||||||
use async_std::sync::{Mutex, RwLock};
|
use async_std::sync::{Mutex, RwLock};
|
||||||
use async_std::task;
|
use async_std::task;
|
||||||
@@ -389,9 +389,14 @@ impl Imap {
|
|||||||
} else {
|
} else {
|
||||||
let can_idle = caps.has_str("IDLE");
|
let can_idle = caps.has_str("IDLE");
|
||||||
let has_xlist = caps.has_str("XLIST");
|
let has_xlist = caps.has_str("XLIST");
|
||||||
let caps_list = caps
|
let caps_list = caps.iter().fold(String::new(), |s, c| {
|
||||||
.iter()
|
if let Capability::Atom(x) = c {
|
||||||
.fold(String::new(), |s, c| s + &format!(" {:?}", c));
|
s + &format!(" {}", x)
|
||||||
|
} else {
|
||||||
|
s + &format!(" {:?}", c)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
self.config.write().await.can_idle = can_idle;
|
self.config.write().await.can_idle = can_idle;
|
||||||
self.config.write().await.has_xlist = has_xlist;
|
self.config.write().await.has_xlist = has_xlist;
|
||||||
*self.connected.lock().await = true;
|
*self.connected.lock().await = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user