ipsservices/ipssosaoplugin/src/IpsSosAOImapPopLogic.cpp
changeset 23 2dc6caa42ec3
parent 18 578830873419
child 30 759dc5235cdb
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOImapPopLogic.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOImapPopLogic.cpp	Fri May 14 15:41:10 2010 +0300
@@ -31,7 +31,7 @@
 #include "IpsSosAOMboxLogic.h"
 #include "IpsSosAOEMNResolver.h"
 //<QMail>
-
+#include "IpsSosAOSettingsHandler.h"
 //</QMail>
 
 
@@ -222,9 +222,6 @@
             result = KErrNotSupported;
             break;
         }
-   
-    
-    // </cmail>
     return result;
     }
 
@@ -232,7 +229,6 @@
 // ----------------------------------------------------------------------------
 // 
 void CIpsSosAOImapPopLogic::HandleMsvSessionEventL(
-// <cmail> RD_IPS_AO_PLUGIN flag removed
      MMsvSessionObserver::TMsvSessionEvent aEvent, 
      TAny* aArg1, TAny* aArg2, TAny* /*aArg3*/ )
     {
@@ -275,7 +271,6 @@
         default:
             break;
         };
-    // </cmail>
     }
 
 // ----------------------------------------------------------------------------
@@ -343,14 +338,13 @@
         if ( index != KErrNotFound )
             {
             CIpsSosAOMBoxLogic* logic = iMailboxLogics[index];
-            //<cmail>
+            
 			if ( !logic->FirstEMNReceived() )
                 {
                 logic->SetFirstEMNReceived();
                 }
             if ( !iNoNWOpsAllowed && 
                  !logic->IsMailboxRoamingStoppedL() )
-            //</cmail>
                 {
                 SendCommandToSpecificMailboxL( 
                     logic->GetMailboxId(), // faulty CS warning
@@ -358,17 +352,11 @@
                 }
             else
                 {
-                //<cmail>
-                logic->SetEmnReceivedFlagL( ETrue );
-                //</cmail>
+                logic->SetEmnReceivedFlagL( ETrue );                
                 }
             logic = NULL;
             }
-/*<cmail>
-        else
-            {
-            }
-</cmail>*/
+
         }
     }
 
@@ -412,32 +400,33 @@
                 }
             }
 		//<QMail>
-        /*
-        CIpsSetDataExtension* extSet = CIpsSetDataExtension::NewLC();
-        TRAPD( error, iDataApi->LoadExtendedSettingsL( 
-                mboxId, *extSet ) );
-        if ( error == KErrNone  )
+        CIpsSosAOSettingsHandler* settings = 
+                 CIpsSosAOSettingsHandler::NewL(iSession, mboxId);
+        CleanupStack::PushL(settings);
+         
+        if ( !found  && ( settings->AlwaysOnlineState() 
+                != IpsServices::EMailAoOff || 
+                    settings->EmailNotificationState() 
+                != IpsServices::EMailEmnOff || 
+                    !settings->FirstEmnReceived() )
+                 )
             {
-            if ( !found  && ( extSet->AlwaysOnlineState() != EMailAoOff || 
-                    extSet->EmailNotificationState() != EMailEmnOff || 
-                    !extSet->FirstEmnReceived() )
-                     )
-                {
-                CIpsSosAOMBoxLogic* newLogic = CIpsSosAOMBoxLogic::NewL( 
-                        iSession, mboxId );
-                CleanupStack::PushL( newLogic );
-                iMailboxLogics.AppendL( newLogic );
-                CleanupStack::Pop( newLogic );
-                }
-            else if ( found && extSet->AlwaysOnlineState() == EMailAoOff &&
-                    extSet->EmailNotificationState() == EMailEmnOff &&
-                    extSet->FirstEmnReceived() )
-                {
-                StopAndRemoveMailboxL( mboxId );
-                }
+            CIpsSosAOMBoxLogic* newLogic = CIpsSosAOMBoxLogic::NewL( 
+                    iSession, mboxId );
+            CleanupStack::PushL( newLogic );
+            iMailboxLogics.AppendL( newLogic );
+            CleanupStack::Pop( newLogic );
             }
-        CleanupStack::PopAndDestroy( extSet );
-        */
+        else if ( found && settings->AlwaysOnlineState() 
+                == IpsServices::EMailAoOff &&
+                    settings->EmailNotificationState() 
+                == IpsServices::EMailEmnOff &&
+                    settings->FirstEmnReceived() )
+            {
+            StopAndRemoveMailboxL( mboxId );
+            }
+        
+        CleanupStack::PopAndDestroy(settings);
 		//</QMail>
         }
     }