ipsservices/ipssosplugin/src/ipsplgpop3fetchoperation.cpp
changeset 43 99bcbff212ad
parent 23 2dc6caa42ec3
child 68 83cc6bae1de8
--- a/ipsservices/ipssosplugin/src/ipsplgpop3fetchoperation.cpp	Mon May 24 21:02:02 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgpop3fetchoperation.cpp	Fri May 28 13:56:43 2010 +0300
@@ -145,20 +145,21 @@
 
     iState = EStateConnecting;
     iStatus = KRequestPending;
-    
-    // when connecting for the fetch operation, don't let connect operation to do fetch,
-    // because we do it by ourself. That's why give 0 to connect operation.    
+    // <qmail>
     CIpsPlgPop3ConnectOp* connOp = CIpsPlgPop3ConnectOp::NewL(
         iMsvSession,
         iStatus, 
         iService, 
-        EFalse, 
+        EFalse, // We do fetch by ourselves
         *iActivityTimer,
         iFSMailboxId, 
         iFSOperationObserver, 
         iFSRequestId, 
-        NULL );
+        NULL,
+        EFalse, // Signalling not allowed
+        ETrue ); // Fetch will follow, let connection be open
         
+    // </qmail>    
     delete iSubOperation;
     iSubOperation = connOp;
 
@@ -344,9 +345,8 @@
                 progress.iErrorCode = err;
                 iFetchErrorProgress = paramPack.AllocL();
                 }
+            DoDisconnectL();
             
-            iState = EStateIdle;
-            CompleteObserver( err );
             if ( iEventHandler )
                 {
 				// <qmail>
@@ -355,6 +355,11 @@
                 }
             }
             break;
+        case EStateDisconnecting:
+            {
+            CompleteObserver( iStatus.Int() );
+            }
+            break;
             
         default:
             break;
@@ -409,3 +414,16 @@
     }
 // </qmail>
 
+//<qmail> new function
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+void CIpsPlgPop3FetchOperation::DoDisconnectL()
+    {
+    FUNC_LOG;
+    iState = EStateDisconnecting;
+    InvokeClientMtmAsyncFunctionL( KPOP3MTMDisconnect, iService ); // <qmail> 1 param removed
+    SetActive();
+    }
+// </qmail>
+
+