onServerResponse method

void onServerResponse(
  1. ImapResponse imapResponse
)

Implementation

void onServerResponse(ImapResponse imapResponse) {
  if (isLogEnabled) {
    log(imapResponse, isClient: false);
  }
  final line = imapResponse.parseText;
  //final log = imapResponse.toString().replaceAll("\r\n", "<RT><LF>\n");
  //log("S: $log");

  //log("subline: " + line);
  if (line.startsWith('* ')) {
    // this is an untagged response and can be anything
    imapResponse.parseText = line.substring('* '.length);
    onUntaggedResponse(imapResponse);
  } else if (line.startsWith('+ ')) {
    imapResponse.parseText = line.substring('+ '.length);
    onContinuationResponse(imapResponse);
  } else {
    onCommandResult(imapResponse);
  }
}