idleStart method

Future idleStart()

Switches to IDLE mode. Requires a mailbox to be selected.

Implementation

Future idleStart() {
  if (_selectedMailbox == null) {
    print('$logName: idleStart(): ERROR: no mailbox selected');
    return Future.value();
  }
  if (_isInIdleMode) {
    log('Warning: idleStart() called but client is already in IDLE mode.',
        initial: ClientBase.initialApp);
    return Future.value();
  }
  _isInIdleMode = true;
  final cmd = Command('IDLE');
  final task = CommandTask(cmd, nextId(), NoopParser(this, _selectedMailbox));
  _tasks[task.id] = task;
  _idleCommandTask = task;
  return sendCommandTask(task, returnCompleter: false);
}