voipplugins/sipconnectionprovider/src/scppresencehandler.cpp
branchRCL_3
changeset 11 bddb6d4447db
parent 10 7117cbf1600a
child 15 ed1e38b404e5
equal deleted inserted replaced
10:7117cbf1600a 11:bddb6d4447db
     1 /*
     1 /*
     2 * Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    37 #include <ownpresenceevent.h>
    37 #include <ownpresenceevent.h>
    38 #include <ximpclient.h>
    38 #include <ximpclient.h>
    39 #include <ximpcontext.h>
    39 #include <ximpcontext.h>
    40 #include <ximpstatus.h>
    40 #include <ximpstatus.h>
    41 #include <pressettingsapi.h> //presence settings
    41 #include <pressettingsapi.h> //presence settings
    42 #include <XdmSettingsApi.h>
    42 #include <xdmsettingsapi.h>
    43 #include <cvimpstsettingsstore.h>
    43 #include <cvimpstsettingsstore.h>
    44 
    44 
    45 #include "scppresencehandler.h"
    45 #include "scppresencehandler.h"
    46 #include "scpsubservice.h"
    46 #include "scpsubservice.h"
    47 #include "scpservicestorage.h"
    47 #include "scpservicestorage.h"
   320         iSubService.HandleConnectionEvent( aEvent );
   320         iSubService.HandleConnectionEvent( aEvent );
   321         }
   321         }
   322     SCPLOGSTRING( "CScpPresenceHandler::HandleSipConnectionEvent OUT" );
   322     SCPLOGSTRING( "CScpPresenceHandler::HandleSipConnectionEvent OUT" );
   323     }    
   323     }    
   324 
   324 
       
   325 // -----------------------------------------------------------------------------
       
   326 // CScpPresenceHandler::HandleSipConnectionEvent
       
   327 // -----------------------------------------------------------------------------
       
   328 //
       
   329 TBool CScpPresenceHandler::IsSipProfileAllowedToStartAlr()
       
   330     {
       
   331     return EFalse;
       
   332     }
   325 
   333 
   326 // ======================= From MXIMPContextObserver ===========================
   334 // ======================= From MXIMPContextObserver ===========================
   327 
   335 
   328 // -----------------------------------------------------------------------------
   336 // -----------------------------------------------------------------------------
   329 // CScpPresenceHandler::HandlePresenceContextEvent
   337 // CScpPresenceHandler::HandlePresenceContextEvent
   693     MPresenceInfoField* infoField2 = 
   701     MPresenceInfoField* infoField2 = 
   694         iFeature->PresenceObjectFactory().NewInfoFieldLC();
   702         iFeature->PresenceObjectFactory().NewInfoFieldLC();
   695     
   703     
   696     MPresenceInfoFieldValueEnum* enumField2 = 
   704     MPresenceInfoFieldValueEnum* enumField2 = 
   697         iFeature->PresenceObjectFactory().NewEnumInfoFieldLC();
   705         iFeature->PresenceObjectFactory().NewEnumInfoFieldLC();
   698     
       
   699     TInt availabilityEnum(0);
   706     TInt availabilityEnum(0);
   700     RBuf customMessage;
   707     RBuf customMessage;
   701     CleanupClosePushL( customMessage );
   708     CleanupClosePushL( customMessage );
   702     customMessage.Create( KCustomMessageMaxLength );
   709     customMessage.Create( KCustomMessageMaxLength );
   703     GetStoredPresenceValuesL( availabilityEnum, customMessage );
   710     GetStoredPresenceValuesL( availabilityEnum, customMessage );
   908         }
   915         }
   909     
   916     
   910     // Unbind request complete
   917     // Unbind request complete
   911     else if ( reqType == EUnBindReq && EUnBinding == iPresenceState )
   918     else if ( reqType == EUnBindReq && EUnBinding == iPresenceState )
   912         {
   919         {
   913         SCPLOGSTRING( "CScpPresenceHandler::HandleRequestCompleteEvent status offline" );       
   920         SCPLOGSTRING( "CScpPresenceHandler::HandleRequestCompleteEvent status offline" );
   914         DeregisterNow();
   921         
       
   922         // Do not send info to our client if roaming is ongoing 
       
   923         if ( !iSubService.IsRoaming() )
       
   924             {
       
   925             DeregisterNow();
       
   926             }
       
   927 		// Inform SIP to start ALR migration
       
   928         else
       
   929             {
       
   930             iSubService.ProfileHandler().StartAlrMigration( iSubService.SipProfileId() );
       
   931             }
       
   932         
   915         SCPLOGSTRING( "CScpPresenceHandler::HandleRequestCompleteEvent status offline end" );
   933         SCPLOGSTRING( "CScpPresenceHandler::HandleRequestCompleteEvent status offline end" );
   916         }
   934         }
   917     
   935     
   918     if ( iRebind )
   936     if ( iRebind )
   919         {
   937         {