voipplugins/sipconnectionprovider/ipvoicemailengine/src/ipvmbxbase.cpp
branchRCL_3
changeset 10 ed1e38b404e5
parent 0 a4daefaec16c
--- a/voipplugins/sipconnectionprovider/ipvoicemailengine/src/ipvmbxbase.cpp	Mon Mar 15 12:39:55 2010 +0200
+++ b/voipplugins/sipconnectionprovider/ipvoicemailengine/src/ipvmbxbase.cpp	Wed Mar 31 21:20:05 2010 +0300
@@ -28,8 +28,6 @@
 
 const TInt KMinReSubscribeDelta = 600; // 10 min
 const TInt KMaxReSubscribeDelta = 86400; // 24 h
-const TUint32 KServerRefreshInterval = KMaxReSubscribeDelta;
-const TInt KSecondsToMicro = 1000000;
 
 _LIT8( KEventHeader8, "message-summary" );
 
@@ -47,7 +45,6 @@
         iSipProfile( NULL ),
         iMceOutEvent( NULL ),
         iMceManager( aMceManager ),
-        iReSubscribe( NULL ),
         iVmbxEngine( aVmbxEngine )
     {
     }
@@ -59,13 +56,10 @@
 //
 void CIpVmbxBase::ConstructL( TDesC8& aVoiceMailUri8 )
     {
-    iReSubscribe = CDeltaTimer::NewL( CActive::EPriorityIdle );
     if ( iVmbxUri8.MaxLength() >= aVoiceMailUri8.Length() )
         {
         iVmbxUri8.Copy( aVoiceMailUri8 );
         }
-    TCallBack cb( ReSubscribe, this );
-    iUpdateEvent.Set( cb );
     }
 
 
@@ -99,11 +93,6 @@
     {
     IPVMEPRINT( "CIpVmbxBase::~CIpVmbxBase - IN" );
 
-    if ( iReSubscribe )
-        {
-        iReSubscribe->Remove( iUpdateEvent );
-        }
-    delete iReSubscribe;
     delete iMceOutEvent;
 
     IPVMEPRINT( "CIpVmbxBase::~CIpVmbxBase - OUT" );
@@ -143,8 +132,11 @@
             aReSubscribe = KMaxReSubscribeDelta;
             }
 
-    iReSubscribePeriod = ( TInt64 ) aReSubscribe * ( TInt64 ) KSecondsToMicro;
-
+    TUint32 resubscribeInterval = ( TUint32 ) aReSubscribe;
+        
+    IPVMEPRINT2( "CIpVmbxAppBase::SubscribeL - resubscribe interval=%d",
+        resubscribeInterval );
+    
     __ASSERT_DEBUG( !iMceOutEvent, Panic( KErrAlreadyExists ) );
 
     if ( !iMceOutEvent )
@@ -154,7 +146,7 @@
             *iSipProfile,
             iVmbxUri8,
             KEventHeader8,
-            KServerRefreshInterval );
+            resubscribeInterval );
         }
     else
         {
@@ -183,7 +175,6 @@
     {
     IPVMEPRINT( "CIpVmbxAppBase::TerminateEventL - IN" );
 
-    iReSubscribe->Remove( iUpdateEvent );
     if ( iMceOutEvent && CMceEvent::EActive == iMceOutEvent->State() )
         {
         iMceOutEvent->TerminateL();
@@ -209,68 +200,6 @@
     }
 
 
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TInt CIpVmbxBase::ReSubscribe( TAny* aThis )
-    {
-    CIpVmbxBase* base = reinterpret_cast<CIpVmbxBase*> ( aThis );
-    __ASSERT_DEBUG( base, Panic( KErrArgument ) );
-    IPVMEPRINT2(
-        "CIpVmbxAppBase::ReSubscribeL - IN state: %d",
-        base->iMceOutEvent->State() );
-
-    if ( base && base->iMceOutEvent )
-        {
-        switch ( base->iMceOutEvent->State() )
-            {
-            case CMceEvent::EActive:
-                {
-                TRAPD( err, base->iMceOutEvent->UpdateL( KServerRefreshInterval ) );
-                if ( err )
-                    {
-                    base->iVmbxEngine.HandleMessage(
-                        base->iServiceProviderId, CIpVmbxEngine::EEngineNetworkError );
-                    }
-                base->iPendingResubscribeCount = 0;
-                if ( !base->iReSubscribe->IsActive() )
-                    {
-                    base->iReSubscribe->QueueLong(
-                        base->iReSubscribePeriod,
-                        base->iUpdateEvent );
-                    }
-                break;
-                }
-            case CMceEvent::EPending:
-                {
-                if ( base->iPendingResubscribeCount++ )
-                    {
-                    // Allows to skip one resubscribe before error occurs
-                    base->iVmbxEngine.HandleMessage(
-                        base->iServiceProviderId,
-                        CIpVmbxEngine::EEngineNetworkLost );
-                    }
-                break;
-                }
-            case CMceEvent::EIdle:
-            case CMceEvent::ETerminated:
-                {
-                base->iVmbxEngine.HandleMessage(
-                    base->iServiceProviderId,
-                    CIpVmbxEngine::EEngineNetworkLost );
-                break;
-                }
-            default:
-                IPVMEPRINT( "Unhandled message!" );
-            }
-        }
-
-    IPVMEPRINT( "CIpVmbxAppBase::ReSubscribeL - OUT" );
-    return KErrNone;
-    }
-
-
 // ----------------------------------------------------------------------------
 //
 // ----------------------------------------------------------------------------
@@ -278,7 +207,6 @@
 void CIpVmbxBase::Cancel()
     {
     iState = EDisabled;
-    iReSubscribe->Remove( iUpdateEvent );
     }
 
 
@@ -309,10 +237,6 @@
 void CIpVmbxBase::SetStateRegistered()
     {
     iState = ERegistered;
-    if ( !iReSubscribe->IsActive() )
-        {
-        iReSubscribe->QueueLong( iReSubscribePeriod, iUpdateEvent );
-        }
     }