| 641 | } |
| 642 | |
| 643 | int ServerPrivate::parseCaps() |
| 644 | { |
| 645 | Q_Q(Server); |
| 646 | |
| 647 | // Save the server's response |
| 648 | const QByteArray responseText = socket->readLine().trimmed(); |
| 649 | qCDebug(SIMPLEMAIL_SERVER) << "Got response" << responseText; |
| 650 | |
| 651 | // Extract the respose code from the server's responce (first 3 digits) |
| 652 | int responseCode = responseText.left(3).toInt(); |
| 653 | if (responseCode == 250) { |
| 654 | caps.append(QString::fromLatin1(responseText)); |
| 655 | if (responseText[3] == ' ') { |
| 656 | return 1; |
| 657 | } else { |
| 658 | return 0; |
| 659 | } |
| 660 | } else { |
| 661 | const QString lastError = QString::fromLatin1(responseText); |
| 662 | qCWarning(SIMPLEMAIL_SERVER) << "Unexpected server caps" << lastError; |
| 663 | Q_EMIT q->smtpError(Server::ServerError, lastError); |
| 664 | return -1; |
| 665 | } |
| 666 | } |
| 667 | |
| 668 | void ServerPrivate::commandReset() |
| 669 | { |
nothing calls this directly
no outgoing calls
no test coverage detected