selectMailboxByFlag method
Future<Mailbox>
selectMailboxByFlag(
- MailboxFlag flag, {
- bool enableCondStore = false,
- QResyncParameters? qresync,
Selects the mailbox/folder with the specified flag
.
Optionally specify if CONDSTORE
support should be enabled
with enableCondStore
.
Optionally specify quick resync parameters with qresync
.
Implementation
Future<Mailbox> selectMailboxByFlag(
MailboxFlag flag, {
bool enableCondStore = false,
QResyncParameters? qresync,
}) async {
var mailboxes = _mailboxes;
mailboxes ??= await listMailboxes();
final mailbox = getMailbox(flag, mailboxes);
if (mailbox == null) {
throw MailException(this, 'Unknown mailbox with flag <$flag>');
}
final box = await _incomingLock.synchronized(
() => _incomingMailClient.selectMailbox(
mailbox,
enableCondStore: enableCondStore,
qresync: qresync,
),
);
_selectedMailbox = box;
return box;
}