Diffstat (limited to 'noncore/unsupported/mailit/popclient.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mailit/popclient.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/unsupported/mailit/popclient.cpp b/noncore/unsupported/mailit/popclient.cpp index 2f14ed2..f9cc337 100644 --- a/noncore/unsupported/mailit/popclient.cpp +++ b/noncore/unsupported/mailit/popclient.cpp @@ -110,37 +110,37 @@ void PopClient::errorHandling(int status) void PopClient::incomingData() { QString response, temp, temp2, timeStamp; QString md5Source; int start, end; // char *md5Digest; char md5Digest[16]; // if ( !socket->canReadLine() ) // return; response = socket->readLine(); - qDebug(response +" %d", status); + //qDebug(response +" %d", status); switch(status) { //logging in case Init: { #ifdef APOP_TEST start = response.find('<',0); end = response.find('>', start); if( start >= 0 && end > start ) { timeStamp = response.mid( start , end - start + 1); md5Source = timeStamp + popPassword; - qDebug( md5Source); + //qDebug( md5Source); // for( int i = 0; i < md5Source.length(); i++) { // buff[i] = (QChar)md5Source[i]; // } md5_buffer( (char const *)md5Source, md5Source.length(),&md5Digest[0]); // md5_buffer(char const *buffer, unsigned int len, char *digest); // MD5_Init( &ctx); // MD5_Update( &ctx, buff, sizeof( buff) ); // MD5_Final( md5Digest, &ctx); // MD5( buff, md5Source.length(), md5Digest); @@ -183,25 +183,25 @@ void PopClient::incomingData() if (response[0] == '+') { temp = response.replace(0, 4, ""); int x = temp.find(" ", 0); temp.truncate((uint) x); newMessages = temp.toInt(); messageCount = 1; status = List; if (synchronize) { //messages deleted from server, reload all if (newMessages < lastSync) lastSync = 0; - messageCount = lastSync + 1; + messageCount = 1; } if (selected) { int *ptr = mailList->first(); if (ptr != 0) { newMessages++; //to ensure no early jumpout messageCount = *(mailList->first()); } else newMessages = 0; } } else errorHandling(ErrUnknownResponse); } //Read message number x, count upwards to messageCount @@ -231,25 +231,25 @@ void PopClient::incomingData() //get size of message, eg "500 characters in message.." -> int 500 case Size: { if (status != Quit) { //because of idiotic switch if (response[0] == '+') { temp = response.replace(0, 4, ""); int x = temp.find(" ", 0); temp = temp.right(temp.length() - ((uint) x + 1) ); mailSize = temp.toInt(); emit currentMailSize(mailSize); status = Retr; } else { - qWarning(response); + //qWarning(response); errorHandling(ErrUnknownResponse); } } } //Read message number x, count upwards to messageCount case Retr: { if (status != Quit) { if (!preview || mailSize <= headerLimit) { *stream << "RETR " << messageCount << "\r\n"; } else { //only header *stream << "TOP " << messageCount << " 0\r\n"; } @@ -277,25 +277,25 @@ void PopClient::incomingData() response = socket->readLine(); message += response; } emit downloadedSize(message.length()); int x = message.find("\r\n.\r\n",-5); if (x == -1) { break; } else { //message reach entire size //complete mail downloaded if ( (!preview ) || ((preview) && (mailSize <= headerLimit)) ){ emit newMessage(message, messageCount-1, mailSize, TRUE); } else { //incomplete mail downloaded - emit newMessage(message, messageCount-1, mailSize, FALSE); + emit newMessage(message, messageCount-1, mailSize, FALSE); } if (messageCount > newMessages) //that was the last message status = Quit; else { //ask for new message if (selected) { //grab next from queue int *ptr = mailList->next(); if (ptr != 0) { messageCount = *ptr; *stream << "LIST " << messageCount << "\r\n"; status = Size; //completing a previously closed transfer if ( (messageCount - lastSync) <= 0) { |