contentpublishingsrv/contentpublishingserver/cpserver/src/cpserversession.cpp
branchRCL_3
changeset 64 b276298d5729
parent 59 a0713522ab97
child 74 edd621764147
equal deleted inserted replaced
59:a0713522ab97 64:b276298d5729
   381             aMessage.GetDesLength( KDescriptorPosition) < KErrNone )
   381             aMessage.GetDesLength( KDescriptorPosition) < KErrNone )
   382             {
   382             {
   383             iServer->PanicClient( aMessage, ECPServerBadRequest );
   383             iServer->PanicClient( aMessage, ECPServerBadRequest );
   384             User::Leave( KErrGeneral );
   384             User::Leave( KErrGeneral );
   385             }
   385             }
       
   386         isRegister = ETrue;
   386         if ( !iNotificationHandler )
   387         if ( !iNotificationHandler )
   387             {
   388             {
   388             iNotificationHandler = CCPNotificationHandler::NewL(
   389             iNotificationHandler = CCPNotificationHandler::NewL(
   389                                                iServer->GetNotifications());
   390                                                iServer->GetNotifications());
   390             iDataManager->AddObserverL( iNotificationHandler );
   391             iDataManager->AddObserverL( iNotificationHandler );
   391             }
   392             }
   392         iNotificationHandler->SaveMessageL( aMessage );
   393         iNotificationHandler->SaveMessageL( aMessage );
   393         isRegister = ETrue;
       
   394         }
   394         }
   395     else
   395     else
   396         {
   396         {
   397         User::Leave( KErrInUse );
   397         User::Leave( KErrInUse );
   398         }
   398         }
   430 // --------------- --------------------------------------------------------------
   430 // --------------- --------------------------------------------------------------
   431 //
   431 //
   432 void CCPServerSession::UnregisterObserverL()
   432 void CCPServerSession::UnregisterObserverL()
   433     {
   433     {
   434     CP_DEBUG( _L8("CCPServerSession::UnregisterObserverL()" ) );
   434     CP_DEBUG( _L8("CCPServerSession::UnregisterObserverL()" ) );
   435     if ( isRegister )
   435     if ( isRegister && iNotificationHandler )
   436         {
   436         {
   437         //remove notification handler from an array of sessions in data manager
   437         //remove notification handler from an array of sessions in data manager
   438         iDataManager->RemoveObserver( iNotificationHandler );
   438         iDataManager->RemoveObserver( iNotificationHandler );
   439         //reset filter for this session
   439         //reset filter for this session
   440         iNotificationHandler->ErrorComplete( KErrCancel );
   440         iNotificationHandler->ErrorComplete( KErrCancel );
   455 void CCPServerSession::GetChangeInfoDataL( const RMessage2& aMessage )
   455 void CCPServerSession::GetChangeInfoDataL( const RMessage2& aMessage )
   456     {
   456     {
   457     CP_DEBUG( _L8("CCPServerSession::GetChangeInfoData()" ) );
   457     CP_DEBUG( _L8("CCPServerSession::GetChangeInfoData()" ) );
   458     if( iNotificationHandler )
   458     if( iNotificationHandler )
   459         {
   459         {
   460         isRegister = EFalse;
       
   461         ExternalizeAndWriteToClientL( aMessage,
   460         ExternalizeAndWriteToClientL( aMessage,
   462             iNotificationHandler->GetPointerToChangeInfoList( ) );
   461             iNotificationHandler->GetPointerToChangeInfoList( ) );
   463         iNotificationHandler->Reset( );
   462         iNotificationHandler->Reset( );
       
   463         isRegister = EFalse;
   464         }
   464         }
   465     }
   465     }
   466 
   466 
   467 // -----------------------------------------------------------------------------
   467 // -----------------------------------------------------------------------------
   468 // CCPServerSession::ExternalizeAndWriteToClient
   468 // CCPServerSession::ExternalizeAndWriteToClient