summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mailit/popclient.cpp
Side-by-side diff
Diffstat (limited to 'noncore/unsupported/mailit/popclient.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mailit/popclient.cpp80
1 files changed, 19 insertions, 61 deletions
diff --git a/noncore/unsupported/mailit/popclient.cpp b/noncore/unsupported/mailit/popclient.cpp
index 67306be..6105d09 100644
--- a/noncore/unsupported/mailit/popclient.cpp
+++ b/noncore/unsupported/mailit/popclient.cpp
@@ -62,3 +62,3 @@ void PopClient::newConnection(QString target, int port)
receiving = TRUE;
- selected = FALSE;
+ //selected = FALSE;
@@ -186,3 +186,3 @@ void PopClient::incomingData()
- if (selected) {
+ if (selected) {
int *ptr = mailList->first();
@@ -190,5 +190,6 @@ void PopClient::incomingData()
newMessages++; //to ensure no early jumpout
- messageCount = *(mailList->first());
- } else newMessages = 0;
- }
+ messageCount = *ptr;
+ } else newMessages = 0;
+ }
+
} else errorHandling(ErrUnknownResponse);
@@ -206,8 +207,8 @@ void PopClient::incomingData()
//completing a previously closed transfer
- if ( (messageCount - lastSync) <= 0) {
+ /* if ( (messageCount - lastSync) <= 0) {
temp.setNum(messageCount);
emit updateStatus(tr("Previous message ") + temp);
- } else {
+ } else {*/
emit updateStatus(tr("Completing message ") + temp);
- }
+ //}
}
@@ -239,3 +240,3 @@ void PopClient::incomingData()
if (status != Quit) {
- if (mailSize <= headerLimit)
+ if ((selected)||(mailSize <= headerLimit))
{
@@ -274,5 +275,4 @@ void PopClient::incomingData()
} else { //message reach entire size
- //complete mail downloaded
- //if ( (!preview ) || ((preview) && (mailSize <= headerLimit)) ){
- if ( mailSize <= headerLimit)
+
+ if ( (selected)||(mailSize <= headerLimit)) //mail size limit is not used if late download is active
{
@@ -282,21 +282,7 @@ void PopClient::incomingData()
}
- if (messageCount > newMessages) //that was the last message
+
+ if ((messageCount > newMessages)||(selected)) //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) {
- temp.setNum(messageCount);
- emit updateStatus(tr("Previous message ") + temp);
- } else {
- temp.setNum(messageCount - lastSync);
- emit updateStatus(tr("Completing message ") + temp);
- }
- break;
- } else {
newMessages--;
@@ -304,3 +290,5 @@ void PopClient::incomingData()
}
- } else {
+ }
+ else
+ {
*stream << "LIST " << messageCount << "\r\n";
@@ -312,3 +300,3 @@ void PopClient::incomingData()
break;
- }
+ }
}
@@ -317,3 +305,2 @@ void PopClient::incomingData()
break;
- }
}
@@ -338,30 +325 @@ void PopClient::incomingData()
}
-
-// if( bAPOPAuthentication )
-// {
-// if( m_strTimeStamp.IsEmpty() )
-// {
-// SetLastError("Apop error!");
-// return false;
-// }
-// strMD5Source = m_strTimeStamp+pszPassword;
-// strMD5Dst = MD5_GetMD5( (BYTE*)(const char*)strMD5Source , strMD5Source.GetLength() );
-// sprintf(msg , "apop %s %s\r\n" , pszUser , strMD5Dst);
-// ret = send(m_sPop3Socket , msg , strlen(msg) , NULL);
-// if(ret == SOCKET_ERROR)
-// {
-// SetLastError("Socket error!");
-// m_bSocketOK = false;
-// m_bConnected = false;
-// return false;
-// }
-// if( !GetSocketResult(&strResult , COMMAND_END_FLAG) )
-// return false;
-// if( 0 == strResult.Find('-' , 0) )
-// {
-// SetLastError("Username or Password error!");
-// return false;
-// }
-// m_bConnected = true;
-
-// }