emailservices/emailstore/base_plugin/src/basepluginnotifications.cpp
branchRCL_3
changeset 11 0396474f30f5
parent 8 e1b6206813b4
child 24 d189ee25cf9d
--- a/emailservices/emailstore/base_plugin/src/basepluginnotifications.cpp	Fri Mar 12 15:41:14 2010 +0200
+++ b/emailservices/emailstore/base_plugin/src/basepluginnotifications.cpp	Mon Mar 15 12:39:10 2010 +0200
@@ -126,23 +126,32 @@
     {
     switch ( aEvent )
         {
-        // A backup or restore is in progress.  The message store is unavailable.
-        case EMsgStoreBackupOrRestoreInProgress:
-        // The message store has been wiped, including the password.
-        case EMsgStoreDatabaseWiped:
-        // The message store has transitioned from an authenticated state to an unauthenticated state.
-        case EMsgStoreNotAuthenticated:
+        // The message store is unavailable.  This may be due to 
+        // a backup or restore being in progress, a Pointsec lock being issued,
+        // the disk drive being unavailable, etc.
+        case EMsgStoreUnavailable:
             {
-            NotifyGlobalEventL( TFSMailboxUnavailable );
+            // since the store is unavailabe we are unable to get 
+            // list of mailboxes, setting plugin id only
+            TFSMailMsgId id;
+            id.SetPluginId( TUid::Uid( GetPluginId() ) );
+            NotifyGlobalEventL( TFSMailboxUnavailable, id );
             }
         break;
 
-        // The backup or restore completed.  The message store is available again.   
-        case EMsgStoreBackupOrRestoreCompleted:
-        // The message store has transitioned from an unauthenticated state to an authenticated state.
-        case EMsgStoreAuthenticated:
+        // The message store is available again.
+        case EMsgStoreAvailable:
             {
-            NotifyGlobalEventL( TFSMailboxAvailable );
+            RArray<TFSMailMsgId> mailboxes;
+            CleanupClosePushL( mailboxes );
+            ListMailBoxesL( mailboxes );
+
+            for ( TInt i( 0 ); i < mailboxes.Count(); i++ )
+                {
+                NotifyGlobalEventL( TFSMailboxAvailable, mailboxes[i] );
+                }
+
+            CleanupStack::PopAndDestroy( &mailboxes );
             }
         break;
 
@@ -151,6 +160,7 @@
         // which many message store operations have occurred.
         case EObserverEventQueueOverflow:
         //don't see anything meaningful to do here.
+        default:
         break;
         };
     }