messagingapp/msgsettings/msginit/src/simscnumberdetector.cpp
changeset 52 12db4185673b
parent 44 36f374c67aa8
child 70 a15d9966050f
--- a/messagingapp/msgsettings/msginit/src/simscnumberdetector.cpp	Tue Jul 06 14:12:40 2010 +0300
+++ b/messagingapp/msgsettings/msginit/src/simscnumberdetector.cpp	Wed Aug 18 09:45:25 2010 +0300
@@ -28,6 +28,7 @@
 #include <startupdomainpskeys.h>
 #include <rcustomerserviceprofilecache.h>
 
+#include "coutboxobserver.h"
 #include "simscnumberdetector.h"
 #include "startupmonitor.h"
 
@@ -67,6 +68,9 @@
 
     // initialise
     iMsvSession = CMsvSession::OpenSyncL(*this);
+   
+    // Observes the OUTBOX for any offline messages...
+    iOutBoxObserver = COutboxObserver::NewL();
 
     // Create the SMS Service	
     TMsvId serviceId = CreateSmsServiceL();
@@ -80,6 +84,9 @@
 
     // Start the System state monitor
     iStartupMonitor = CStartUpMonitor::NewL(this);
+    
+    // Start the Auto-send AO, to handle offline SMS messages
+    iOutBoxObserver->HandleMsvSessionReadyL(*iMsvSession);
 
     QDEBUG_WRITE("CMsgSimOperation::ConstructL exit")
     }
@@ -297,6 +304,10 @@
     delete iSimOperation;
     delete iSmsClientMtm;
     delete iClientRegistry;
+    
+    delete iOutBoxObserver;
+    iOutBoxObserver = NULL;
+    
     delete iMsvSession;
     delete iStartupMonitor;
     iStartupMonitor = NULL;
@@ -487,7 +498,11 @@
 
         delete iClientRegistry;
         iClientRegistry = NULL;
-
+        
+        iOutBoxObserver->HandleMsvSessionClosedL();
+        delete iOutBoxObserver;
+        iOutBoxObserver = NULL;
+        
         delete iMsvSession;
         iMsvSession = NULL;