presencefwsimpleadpt/src/simplepluginauthorization.cpp
branchRCL_3
changeset 35 fbd2e7cec7ef
equal deleted inserted replaced
34:2669f8761a99 35:fbd2e7cec7ef
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    SIMPLE Protocol implementation for Presence Framework
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #include <e32std.h>
       
    23 
       
    24 #include <ximpdatasubscriptionstate.h>
       
    25 #include <protocolpresenceauthorizationdatahost.h>
       
    26 #include <ximpobjectfactory.h>
       
    27 #include <presenceobjectfactory.h>
       
    28 #include <ximpstatus.h>
       
    29 #include <ximpidentity.h>
       
    30 #include <presencegrantrequestinfo.h>
       
    31 #include <ximpobjectcollection.h>
       
    32 #include <presenceblockinfo.h>
       
    33 #include <presenceerrors.hrh>
       
    34 
       
    35 #include <simplefactory.h>
       
    36 #include <msimpleconnection.h>
       
    37 #include <msimplewinfo.h>
       
    38 #include <msimpleelement.h>
       
    39 
       
    40 #include "simplepluginauthorization.h"
       
    41 #include "simpleplugindebugutils.h"
       
    42 #include "simplepluginwinfo.h"
       
    43 #include "simplepluginxdmutils.h"
       
    44 #include "simpleplugincommon.h"
       
    45 #include "simplepluginconnection.h"
       
    46 
       
    47 /**
       
    48     The design is the following one
       
    49 
       
    50     1. DoGrantPresenceForEveryOneL
       
    51       modify default rule to ALLOW.
       
    52 
       
    53     2. DoWithdrawPresenceFromEveryOneL
       
    54       if current rule is ALLOW then
       
    55         {  BLOCK  }
       
    56         otherwise no action.
       
    57 
       
    58     3. DoSubscribePresenceGrantRequestListL
       
    59       modify default rule to CONFIRM.
       
    60 
       
    61     4. DoUnsubscribePresenceGrantRequestListL
       
    62       if current rule is CONFIRM then
       
    63         { go to ALLOW  }
       
    64         otherwise no action.
       
    65 */
       
    66 
       
    67 
       
    68 // ======== MEMBER FUNCTIONS ========
       
    69 
       
    70 // ---------------------------------------------------------------------------
       
    71 // CSimplePluginAuthorization::CSimplePluginAuthorization
       
    72 // ---------------------------------------------------------------------------
       
    73 //
       
    74 CSimplePluginAuthorization::CSimplePluginAuthorization(
       
    75     MSimplePluginConnectionObs& aObs )
       
    76 : CActive( CActive::EPriorityStandard ),
       
    77   iConnObs(aObs),
       
    78   iOperation(ENoOperation),
       
    79   iXdmOk(EFalse), iDefRule(ERuleDef), iWinfoSubs( EFalse )
       
    80     {
       
    81     CActiveScheduler::Add( this );
       
    82     }
       
    83 
       
    84 // ---------------------------------------------------------------------------
       
    85 // CSimplePluginAuthorization::ConstructL
       
    86 // ---------------------------------------------------------------------------
       
    87 //
       
    88 void CSimplePluginAuthorization::ConstructL( )
       
    89     {
       
    90 
       
    91     }
       
    92 
       
    93 // ---------------------------------------------------------------------------
       
    94 // CSimplePluginAuthorization::NewL
       
    95 // ---------------------------------------------------------------------------
       
    96 //
       
    97 CSimplePluginAuthorization* CSimplePluginAuthorization::NewL(
       
    98     MSimplePluginConnectionObs& aObs )
       
    99     {
       
   100     CSimplePluginAuthorization* self =
       
   101         new( ELeave ) CSimplePluginAuthorization( aObs );
       
   102     CleanupStack::PushL( self );
       
   103     self->ConstructL(  );
       
   104     CleanupStack::Pop( self );
       
   105 #ifdef _DEBUG
       
   106     PluginLogger::Log(_L("PluginAuthorization: NewL this=%d"), (TInt)self );
       
   107 #endif
       
   108     return self;
       
   109     }
       
   110 
       
   111 // ---------------------------------------------------------------------------
       
   112 // CSimplePluginAuthorization::~CSimplePluginAuthorization
       
   113 // ---------------------------------------------------------------------------
       
   114 //
       
   115 CSimplePluginAuthorization::~CSimplePluginAuthorization()
       
   116     {
       
   117     delete iPresIdentity;
       
   118     }
       
   119 
       
   120 // ---------------------------------------------------------------------------
       
   121 // CSimplePluginAuthorization::SetDataHost
       
   122 // We assume that this method is given by PrFw right after
       
   123 // constrcution.
       
   124 // ---------------------------------------------------------------------------
       
   125 //
       
   126 void CSimplePluginAuthorization::SetDataHost(
       
   127     MProtocolPresenceAuthorizationDataHost& aDataHost )
       
   128     {
       
   129     iDataHost = &aDataHost;
       
   130     }
       
   131 
       
   132 // ---------------------------------------------------------------------------
       
   133 // CSimplePluginAuthorization::WinfoTerminatedL
       
   134 // ---------------------------------------------------------------------------
       
   135 //
       
   136 void CSimplePluginAuthorization::WinfoTerminatedL( TInt /*aReason*/ )
       
   137     {
       
   138 #ifdef _DEBUG
       
   139     PluginLogger::Log(_L("PluginAuthorization: WinfoTerminatedL") );
       
   140 #endif
       
   141 
       
   142     if ( iWinfoSubs )
       
   143         {
       
   144         MXIMPDataSubscriptionState* myState = iConnObs.ObjectFactory().NewDataSubscriptionStateLC();
       
   145         MXIMPStatus* myStatus = iConnObs.ObjectFactory().NewStatusLC();
       
   146         // Notice: consider error codes
       
   147         myStatus->SetResultCode( KErrCompletion );
       
   148         myState->SetSubscriptionStateL(
       
   149             MXIMPDataSubscriptionState::ESubscriptionInactive );
       
   150 
       
   151         // parameters' OWNERSHIP is taken
       
   152         iDataHost->SetPresenceGrantRequestDataSubscriptionStateL(
       
   153             myState,
       
   154             myStatus );
       
   155 
       
   156         iWinfoSubs = EFalse;
       
   157 
       
   158         CleanupStack::Pop( /*myStatus*/ );
       
   159         CleanupStack::Pop( /*myState*/ );
       
   160         }
       
   161  }
       
   162 
       
   163 // ---------------------------------------------------------------------------
       
   164 // CSimplePluginAuthorization::DoSubscribePresenceGrantRequestListL
       
   165 // ---------------------------------------------------------------------------
       
   166 //
       
   167 void CSimplePluginAuthorization::DoSubscribePresenceGrantRequestListL(
       
   168     TXIMPRequestId aReqId )
       
   169     {
       
   170 #ifdef _DEBUG
       
   171     PluginLogger::Log(_L("PluginAuthorization: DoSubscribePresenceGrantRequestListL"));
       
   172 #endif
       
   173 
       
   174     /*
       
   175     This means Reactive authorization, i.e. modify default rule as CONFIRM.
       
   176     Also this starts the WINFO subscription.
       
   177 
       
   178     Once the authorization request is received the
       
   179     MProtocolPresenceAuthorizationDataHost::HandlePresenceGrantRequestReceivedL shall
       
   180     be called in the host API.
       
   181 
       
   182     First make the watcher list SIP subscription and after that is completed
       
   183     in HandleIfMine then continue and modify XDMS authentication rule.
       
   184     HandleIfMine can be called also immediately if there already exists an WINFO subscrption.
       
   185     */
       
   186 
       
   187     iOperation = ESubscribePresenceGrantRequestList;
       
   188     iPrFwId = aReqId;
       
   189     TRAPD( err, iConnObs.WinfoHandlerL()->SubscribeWinfoListL( aReqId ));
       
   190     if ( err )
       
   191         {
       
   192         iOperation = ENoOperation;
       
   193         User::Leave( CSimplePluginConnection::HarmonizeErrorCode( err ));
       
   194         }
       
   195     else
       
   196         {
       
   197         iWinfoSubs = ETrue;
       
   198         }
       
   199     }
       
   200 
       
   201 // ---------------------------------------------------------------------------
       
   202 // CSimplePluginAuthorization::DoUnsubscribePresenceGrantRequestListL
       
   203 // ---------------------------------------------------------------------------
       
   204 //
       
   205 void CSimplePluginAuthorization::DoUnsubscribePresenceGrantRequestListL(
       
   206     TXIMPRequestId aReqId )
       
   207     {
       
   208 #ifdef _DEBUG
       
   209     PluginLogger::Log(_L("PluginAuthorization: DoUnsubscribePresenceGrantRequestListL TEST COVERS 4"));
       
   210 #endif
       
   211 
       
   212     // First modify XDMS authentication rule and then unsubscribe
       
   213     // SIP watcher list subscription.
       
   214     TRAPD( err, DoStartXdmOperationL( aReqId, EUnsubscribePresenceGrantRequestList ));
       
   215     if ( err )
       
   216         {
       
   217         User::Leave( CSimplePluginConnection::HarmonizeErrorCode( err ));
       
   218         }
       
   219     iPrFwId = aReqId;
       
   220     }
       
   221 
       
   222 // ---------------------------------------------------------------------------
       
   223 // CSimplePluginAuthorization::DoGrantPresenceForPresentityL
       
   224 // ---------------------------------------------------------------------------
       
   225 //
       
   226 void CSimplePluginAuthorization::DoGrantPresenceForPresentityL(
       
   227     const MXIMPIdentity& aPresentityId,
       
   228     const MPresenceInfoFilter& /*aPif*/,  // notice: pif not supported
       
   229     TXIMPRequestId aReqId )
       
   230     {
       
   231 #ifdef _DEBUG
       
   232     PluginLogger::Log(_L("PluginAuthorization: DoGrantPresenceForPresentityL"));
       
   233 #endif
       
   234     StartXdmOperationL( aPresentityId, aReqId, EGrantPresenceForPresentity );
       
   235     }
       
   236 
       
   237 // ---------------------------------------------------------------------------
       
   238 // CSimplePluginAuthorization::DoUpdatePresenceGrantPifForPresentityL
       
   239 // ---------------------------------------------------------------------------
       
   240 //
       
   241 void CSimplePluginAuthorization::DoUpdatePresenceGrantPifForPresentityL(
       
   242     const MXIMPIdentity& /*aPresentityId*/,
       
   243     const MPresenceInfoFilter& /*aPif*/,
       
   244     TXIMPRequestId /*aReqId*/ )
       
   245     {
       
   246 #ifdef _DEBUG
       
   247     PluginLogger::Log(_L("PluginAuthorization: DoUpdatePresenceGrantPifForPresentityL"));
       
   248 #endif
       
   249     // Notice: aPif filter not supported.
       
   250     User::Leave( KErrNotSupported );
       
   251     }
       
   252 
       
   253 // ---------------------------------------------------------------------------
       
   254 // CSimplePluginAuthorization::DoWithdrawPresenceGrantFromPresentityL
       
   255 // ---------------------------------------------------------------------------
       
   256 //
       
   257 void CSimplePluginAuthorization::DoWithdrawPresenceGrantFromPresentityL(
       
   258     const MXIMPIdentity& aPresentityId,
       
   259     TXIMPRequestId aReqId )
       
   260     {
       
   261 #ifdef _DEBUG
       
   262     PluginLogger::Log(_L("PluginAuthorization: DoWithdrawPresenceGrantFromPresentityL"));
       
   263 #endif
       
   264     StartXdmOperationL( aPresentityId, aReqId, EWithdrawFromPresentity );
       
   265     }
       
   266 
       
   267 // ---------------------------------------------------------------------------
       
   268 // CSimplePluginAuthorization::DoGrantPresenceForPresentityGroupMembersL
       
   269 // ---------------------------------------------------------------------------
       
   270 //
       
   271 void CSimplePluginAuthorization::DoGrantPresenceForPresentityGroupMembersL(
       
   272     const MXIMPIdentity& aGroupId,
       
   273     const MPresenceInfoFilter& /*aPif*/,
       
   274     TXIMPRequestId aReqId )
       
   275     {
       
   276 #ifdef _DEBUG
       
   277     PluginLogger::Log(_L("PluginAuthorization: DoGrantPresenceForPresentityGroupMembersL"));
       
   278 #endif
       
   279     StartXdmOperationL( aGroupId, aReqId, EGrantPresenceForPresentityGroupMembers );
       
   280     }
       
   281 
       
   282 // ---------------------------------------------------------------------------
       
   283 // CSimplePluginAuthorization::DoUpdatePresenceGrantPifForPresentityGroupMembersL
       
   284 // ---------------------------------------------------------------------------
       
   285 //
       
   286 void CSimplePluginAuthorization::DoUpdatePresenceGrantPifForPresentityGroupMembersL(
       
   287     const MXIMPIdentity& /*aGroupId*/,
       
   288     const MPresenceInfoFilter& /*aPif*/,
       
   289     TXIMPRequestId /*aReqId*/ )
       
   290     {
       
   291 #ifdef _DEBUG
       
   292     PluginLogger::Log(_L("PluginAuthorization: DoUpdatePresenceGrantPifForPresentityGroupMembersL"));
       
   293 #endif
       
   294     // Notice: aPif filter not supported
       
   295     User::Leave( KErrNotSupported );
       
   296     }
       
   297 
       
   298 // ---------------------------------------------------------------------------
       
   299 // CSimplePluginAuthorization::DoWithdrawPresenceGrantFromPresentityGroupMembersL
       
   300 // ---------------------------------------------------------------------------
       
   301 //
       
   302 void CSimplePluginAuthorization::DoWithdrawPresenceGrantFromPresentityGroupMembersL(
       
   303     const MXIMPIdentity& aGroupId,
       
   304     TXIMPRequestId aReqId )
       
   305     {
       
   306 #ifdef _DEBUG
       
   307     PluginLogger::Log(_L("PluginAuthorization: DoWithdrawPresenceGrantFromPresentityGroupMembersL"));
       
   308 #endif
       
   309     StartXdmOperationL( aGroupId, aReqId, EWithdrawFromGroupMembers );
       
   310     }
       
   311 
       
   312 // ---------------------------------------------------------------------------
       
   313 // CSimplePluginAuthorization::DoGrantPresenceForEveryoneL()
       
   314 // ---------------------------------------------------------------------------
       
   315 //
       
   316 void CSimplePluginAuthorization::DoGrantPresenceForEveryoneL(
       
   317     const MPresenceInfoFilter& /*aPif*/,   // // Notice: aPif filter not supported
       
   318     TXIMPRequestId aReqId )
       
   319     {
       
   320 #ifdef _DEBUG
       
   321     PluginLogger::Log(_L("PluginAuthorization: DoGrantPresenceForEveryoneL"));
       
   322 #endif
       
   323     MXIMPIdentity* nobody = iConnObs.ObjectFactory().NewIdentityLC();  // << nobody
       
   324     StartXdmOperationL( *nobody, aReqId, EGrantForEveryone );
       
   325     CleanupStack::PopAndDestroy( );                     // >> nobody
       
   326     }
       
   327 
       
   328 // ---------------------------------------------------------------------------
       
   329 // CSimplePluginAuthorization::DoUpdatePresenceGrantPifForEveryoneL()
       
   330 // ---------------------------------------------------------------------------
       
   331 //
       
   332 void CSimplePluginAuthorization::DoUpdatePresenceGrantPifForEveryoneL(
       
   333     const MPresenceInfoFilter& /*aPif*/,
       
   334     TXIMPRequestId /*aReqId*/ )
       
   335     {
       
   336 #ifdef _DEBUG
       
   337     PluginLogger::Log(_L("PluginAuthorization: DoUpdatePresenceGrantPifForEveryoneL"));
       
   338 #endif
       
   339     // Notice: aPif filter not supported
       
   340     User::Leave( KErrNotSupported );
       
   341     }
       
   342 
       
   343 // ---------------------------------------------------------------------------
       
   344 // CSimplePluginAuthorization::DoWithdrawPresenceGrantFromEveryoneL()
       
   345 // ---------------------------------------------------------------------------
       
   346 //
       
   347 void CSimplePluginAuthorization::DoWithdrawPresenceGrantFromEveryoneL(
       
   348     TXIMPRequestId aReqId )
       
   349     {
       
   350 #ifdef _DEBUG
       
   351     PluginLogger::Log(_L("PluginAuthorization: DoWithdrawPresenceGrantFromEveryoneL"));
       
   352 #endif
       
   353     MXIMPIdentity* nobody = iConnObs.ObjectFactory().NewIdentityLC();  // << nobody
       
   354     StartXdmOperationL( *nobody, aReqId, EWithdrawFromEveryone );
       
   355     CleanupStack::PopAndDestroy( );                     // >> nobody
       
   356     }
       
   357 
       
   358 // ---------------------------------------------------------------------------
       
   359 // CSimplePluginAuthorization::DoSubscribePresenceBlockListL()
       
   360 // ---------------------------------------------------------------------------
       
   361 //
       
   362 void CSimplePluginAuthorization::DoSubscribePresenceBlockListL(
       
   363     TXIMPRequestId aReqId )
       
   364     {
       
   365 #ifdef _DEBUG
       
   366     PluginLogger::Log(_L("PluginAuthorization: DoSubscribePresenceBlockListL"));
       
   367 #endif
       
   368     MXIMPIdentity* nobody = iConnObs.ObjectFactory().NewIdentityLC();  // << nobody
       
   369     StartXdmOperationL( *nobody, aReqId, ESubscribeBlockList );
       
   370     CleanupStack::PopAndDestroy( );                     // >> nobody
       
   371     }
       
   372 
       
   373 // ---------------------------------------------------------------------------
       
   374 // CSimplePluginAuthorization::DoUnsubscribePresenceBlockListL()
       
   375 // ---------------------------------------------------------------------------
       
   376 //
       
   377 void CSimplePluginAuthorization::DoUnsubscribePresenceBlockListL(
       
   378     TXIMPRequestId aReqId )
       
   379     {
       
   380 #ifdef _DEBUG
       
   381     PluginLogger::Log(_L("PluginAuthorization: DoUnsubscribePresenceBlockListL"));
       
   382 #endif
       
   383     MXIMPIdentity* nobody = iConnObs.ObjectFactory().NewIdentityLC();  // << nobody
       
   384     StartXdmOperationL( *nobody, aReqId, EUnsubscribeBlockList );
       
   385     CleanupStack::PopAndDestroy( );                     // >> nobody
       
   386     }
       
   387 
       
   388 // Blocking presence information access from single presentities
       
   389 
       
   390 // ---------------------------------------------------------------------------
       
   391 // CSimplePluginAuthorization::DoBlockPresenceForPresentityL()
       
   392 // ---------------------------------------------------------------------------
       
   393 //
       
   394 void CSimplePluginAuthorization::DoBlockPresenceForPresentityL(
       
   395     const MXIMPIdentity& aPresentityId,
       
   396     TXIMPRequestId aReqId )
       
   397     {
       
   398 #ifdef _DEBUG
       
   399     PluginLogger::Log(_L("PluginAuthorization: DoBlockPresenceForPresentityL"));
       
   400 #endif
       
   401     StartXdmOperationL( aPresentityId, aReqId, EBlockPresentity );
       
   402     }
       
   403 
       
   404 // ---------------------------------------------------------------------------
       
   405 // CSimplePluginAuthorization::DoCancelPresenceBlockFromPresentityL()
       
   406 // ---------------------------------------------------------------------------
       
   407 //
       
   408 void CSimplePluginAuthorization::DoCancelPresenceBlockFromPresentityL(
       
   409     const MXIMPIdentity& aPresentityId,
       
   410     TXIMPRequestId aReqId )
       
   411     {
       
   412 #ifdef _DEBUG
       
   413     PluginLogger::Log(_L("PluginAuthorization: DoCancelPresenceBlockFromPresentityL"));
       
   414 #endif
       
   415     StartXdmOperationL( aPresentityId, aReqId, EUnblockPresentity );
       
   416     }
       
   417 
       
   418 // ---------------------------------------------------------------------------
       
   419 // CSimplePluginAuthorization::DoCancel()
       
   420 // ---------------------------------------------------------------------------
       
   421 //
       
   422 void CSimplePluginAuthorization::DoCancel(  )
       
   423     {
       
   424     iXdmUtils->Cancel();
       
   425     }
       
   426 
       
   427 // ---------------------------------------------------------------------------
       
   428 // CSimplePluginAuthorization::RunL()
       
   429 // ---------------------------------------------------------------------------
       
   430 //
       
   431 void CSimplePluginAuthorization::RunL(  )
       
   432     {
       
   433     TInt myStatus = iStatus.Int();
       
   434 
       
   435 #ifdef _DEBUG
       
   436     PluginLogger::Log(_L("PluginAuthorization: RunL %d"), myStatus );
       
   437 #endif
       
   438 
       
   439     if ( iOperation == EUnsubscribePresenceGrantRequestList && !myStatus )
       
   440         {
       
   441         // unsubscribe watcher list after successful default rule modification.
       
   442         TRAPD( err, iConnObs.WinfoHandlerL()->UnsubscribeWinfoListL( iPrFwId ));
       
   443         if ( err )
       
   444             {
       
   445             User::Leave( CSimplePluginConnection::HarmonizeErrorCode( err ));
       
   446             }
       
   447         else
       
   448             {
       
   449             // This will end to HandleIfMine.
       
   450             }
       
   451         }
       
   452     else if ( !iXdmOk && !myStatus )
       
   453         {
       
   454         iXdmOk = ETrue;
       
   455         CallActualXdmOperationL();
       
   456         }
       
   457     else // iXdmOK or myStatus
       
   458         {
       
   459         CompletePrFwReq( myStatus );
       
   460         }
       
   461 
       
   462     }
       
   463 
       
   464 // ---------------------------------------------------------------------------
       
   465 // CSimplePluginAuthorization::CallActualXdmOperationL
       
   466 // ---------------------------------------------------------------------------
       
   467 //
       
   468 void CSimplePluginAuthorization::CallActualXdmOperationL()
       
   469     {
       
   470 #ifdef _DEBUG
       
   471     PluginLogger::Log(_L("PluginAuthorization: CallActualXdmOperationL") );
       
   472 #endif
       
   473     switch ( iOperation )
       
   474         {
       
   475         case EGrantPresenceForPresentity:
       
   476             // iPresIdentity can't be null in this case
       
   477             iXdmUtils->AddEntityToGrantedL( iPresIdentity->Des(), iStatus );
       
   478             SetActive();
       
   479             break;
       
   480         case EWithdrawFromPresentity:
       
   481             // iPresIdentity can't be null in this case
       
   482             iXdmUtils->RemoveEntityFromGrantedL( iPresIdentity->Des(),iStatus );
       
   483             SetActive();
       
   484             break;
       
   485         case EGrantPresenceForPresentityGroupMembers:
       
   486             // iPresIdentity can't be null in this case
       
   487             iXdmUtils->AddGroupToGrantedL( iPresIdentity->Des(), iStatus );
       
   488             SetActive();
       
   489             break;
       
   490         case EWithdrawFromGroupMembers:
       
   491             // iPresIdentity can't be null in this case
       
   492             iXdmUtils->RemoveGroupFromGrantedL( iPresIdentity->Des(), iStatus );
       
   493             SetActive();
       
   494             break;
       
   495         case EGrantForEveryone:
       
   496             iXdmUtils->GrantForEveryoneL( iStatus );
       
   497             SetActive();
       
   498             break;
       
   499         case EWithdrawFromEveryone:
       
   500             iXdmUtils->WithdrawFromEveryoneL( iStatus );
       
   501             SetActive();
       
   502             break;
       
   503         case ESubscribeBlockList:
       
   504             HandleSubscribeBlockListL();
       
   505             break;
       
   506         case EUnsubscribeBlockList:
       
   507             iXdmUtils->UnsubscribeBlockListL( iStatus );
       
   508             SetActive();
       
   509             break;
       
   510         case EBlockPresentity:
       
   511             // iPresIdentity can't be null in this case
       
   512             iXdmUtils->AddEntityToBlockedL( iPresIdentity->Des(), iStatus );
       
   513             SetActive();
       
   514             break;
       
   515         case EUnblockPresentity:
       
   516             // iPresIdentity can't be null in this case
       
   517             iXdmUtils->RemoveEntityFromBlockedL( iPresIdentity->Des(), iStatus );
       
   518             SetActive();
       
   519             break;
       
   520         case ESubscribePresenceGrantRequestList:
       
   521             iXdmUtils->SetReactiveAuthL( iStatus );
       
   522             SetActive();
       
   523             break;
       
   524         case EUnsubscribePresenceGrantRequestList:
       
   525         default:
       
   526             iXdmUtils->SetProactiveAuthL( iStatus );
       
   527             SetActive();
       
   528             break;
       
   529         }
       
   530     }
       
   531 
       
   532 // ---------------------------------------------------------------------------
       
   533 // CSimplePluginAuthorization::CopyBlockersToArrayL
       
   534 // ---------------------------------------------------------------------------
       
   535 //
       
   536 void CSimplePluginAuthorization::CopyBlockersToArrayL(
       
   537         CPtrCArray& aBlockers, RPointerArray<MXIMPIdentity>& aBlockedSouls )
       
   538     {
       
   539     MXIMPObjectFactory& myFactory = iConnObs.ObjectFactory();
       
   540 
       
   541     aBlockedSouls.Reset();
       
   542 
       
   543     TInt nodeCount = aBlockers.Count();
       
   544     for ( TInt i = 0; i < nodeCount; i++ )
       
   545         {
       
   546         MXIMPIdentity* entity = myFactory.NewIdentityLC(); // << entity
       
   547         entity->SetIdentityL( aBlockers[i] );
       
   548         aBlockedSouls.AppendL( entity );
       
   549         CleanupStack::Pop(); // >> entity
       
   550         }
       
   551     }
       
   552 
       
   553 // ---------------------------------------------------------------------------
       
   554 // CSimplePluginAuthorization::RunError
       
   555 // ---------------------------------------------------------------------------
       
   556 //
       
   557 TInt CSimplePluginAuthorization::RunError( TInt aError )
       
   558     {
       
   559 #ifdef _DEBUG
       
   560     PluginLogger::Log(_L("PluginAuthorization: RunError %d"), aError );
       
   561 #endif
       
   562     // complete the open request
       
   563     CompletePrFwReq( aError );
       
   564     return KErrNone;
       
   565     }
       
   566 
       
   567 // ---------------------------------------------------------------------------
       
   568 // CSimplePluginAuthorization::GetInterface()
       
   569 // ---------------------------------------------------------------------------
       
   570 //
       
   571 TAny* CSimplePluginAuthorization::GetInterface(
       
   572         TInt32 aInterfaceId,
       
   573         TIfGetOps aOptions )
       
   574     {
       
   575     if ( aInterfaceId == GetInterfaceId() )
       
   576         {
       
   577         // caller wants this interface
       
   578         MProtocolPresenceAuthorization* myIf = this;
       
   579         return myIf;
       
   580         }
       
   581     if ( aOptions == MXIMPBase::EPanicIfUnknown )
       
   582         {
       
   583         User::Panic( _L("CSimplePlugin"), KErrExtensionNotSupported );
       
   584         }
       
   585     return NULL;
       
   586     }
       
   587 
       
   588 // ---------------------------------------------------------------------------
       
   589 // CSimplePluginAuthorization::GetInterface()
       
   590 // ---------------------------------------------------------------------------
       
   591 //
       
   592 const TAny* CSimplePluginAuthorization::GetInterface(
       
   593     TInt32 aInterfaceId,
       
   594     TIfGetOps aOptions ) const
       
   595     {
       
   596     if ( aInterfaceId == GetInterfaceId() )
       
   597         {
       
   598         // caller wants this interface
       
   599         const MProtocolPresenceAuthorization* myIf = this;
       
   600         return myIf;
       
   601         }
       
   602     if ( aOptions == MXIMPBase::EPanicIfUnknown )
       
   603         {
       
   604         User::Panic( _L("CSimplePlugin"), KErrExtensionNotSupported );
       
   605         }
       
   606     return NULL;
       
   607     }
       
   608 
       
   609 // ---------------------------------------------------------------------------
       
   610 // CSimplePluginAuthorization::GetInterfaceId()
       
   611 // ---------------------------------------------------------------------------
       
   612 //
       
   613 TInt32 CSimplePluginAuthorization::GetInterfaceId() const
       
   614     {
       
   615     return MProtocolPresenceAuthorization::KInterfaceId;
       
   616     }
       
   617 
       
   618 // ---------------------------------------------------------------------------
       
   619 // CSimplePluginAuthorization::SetPresIdentityL()
       
   620 // ---------------------------------------------------------------------------
       
   621 //
       
   622 void CSimplePluginAuthorization::SetPresIdentityL(
       
   623      const MXIMPIdentity& aPresentityId )
       
   624      {
       
   625      delete iPresIdentity;
       
   626      iPresIdentity = NULL;
       
   627      iPresIdentity = aPresentityId.Identity().AllocL();
       
   628      }
       
   629 
       
   630 // ---------------------------------------------------------------------------
       
   631 // CSimplePluginAuthorization::WinfoNotificationL
       
   632 // ---------------------------------------------------------------------------
       
   633 //
       
   634 void CSimplePluginAuthorization::WinfoNotificationL(
       
   635     MSimpleWinfo& aWinfo )
       
   636     {
       
   637     if ( !iWinfoSubs )
       
   638         {
       
   639         return;
       
   640         }
       
   641 #ifdef _DEBUG
       
   642     PluginLogger::Log(_L("PluginAuthorization: WinfoNotificationL starts"));
       
   643 #endif
       
   644 
       
   645     using namespace NSimplePlugin::NSimpleOma;
       
   646 
       
   647     RPointerArray<MSimpleElement> elems;
       
   648     CleanupClosePushL( elems );
       
   649     TInt err = aWinfo.SimpleElementsL( elems );
       
   650     User::LeaveIfError( err );
       
   651     TInt count = elems.Count();
       
   652 
       
   653     if ( !count )
       
   654         {
       
   655         // stop parsing empty notification
       
   656         User::Leave( KErrArgument );
       
   657         }
       
   658 
       
   659     __ASSERT_DEBUG( count == 1, User::Leave( KErrCorrupt ) );
       
   660 
       
   661     const TDesC8* stateVal = aWinfo.AttrValue( KSimpleState8 );
       
   662     if ( stateVal && !stateVal->CompareF( KSimpleFull8 ))
       
   663         {
       
   664         // Call full list method
       
   665         HandleFullWinfoNotificationL( aWinfo );
       
   666         }
       
   667     else
       
   668         {
       
   669         // Indicate changes in WINFO list one by one.
       
   670         HandlePartialWinfoNotificationL( aWinfo );
       
   671         }
       
   672     CleanupStack::PopAndDestroy( &elems );
       
   673 
       
   674 #ifdef _DEBUG
       
   675     PluginLogger::Log(_L("PluginAuthorization: WinfoNotificationL ends"));
       
   676 #endif
       
   677     }
       
   678 
       
   679 // ---------------------------------------------------------------------------
       
   680 // CSimplePluginAuthorization::StartXdmOperationL
       
   681 // ---------------------------------------------------------------------------
       
   682 //
       
   683 void CSimplePluginAuthorization::StartXdmOperationL(
       
   684     const MXIMPIdentity& aId,
       
   685     TXIMPRequestId aReqId,
       
   686     TPluginAuthOperation aOperation )
       
   687     {
       
   688     TRAPD( err, DoStartXdmOperationL(aId, aReqId, aOperation ));
       
   689     if ( err )
       
   690         {
       
   691         User::Leave( CSimplePluginConnection::HarmonizeErrorCode( err ));
       
   692         }
       
   693     }
       
   694 
       
   695 // ---------------------------------------------------------------------------
       
   696 // CSimplePluginAuthorization::DoStartXdmOperationL
       
   697 // ---------------------------------------------------------------------------
       
   698 //
       
   699 void CSimplePluginAuthorization::DoStartXdmOperationL(
       
   700     const MXIMPIdentity& aId,
       
   701     TXIMPRequestId aReqId,
       
   702     TPluginAuthOperation aOperation )
       
   703     {
       
   704     SetPresIdentityL( aId );
       
   705     DoStartXdmOperationL( aReqId, aOperation );
       
   706     }
       
   707 
       
   708 // ---------------------------------------------------------------------------
       
   709 // CSimplePluginAuthorization::DoStartXdmOperationL
       
   710 // ---------------------------------------------------------------------------
       
   711 //
       
   712 void CSimplePluginAuthorization::DoStartXdmOperationL(
       
   713     TXIMPRequestId aReqId,
       
   714     TPluginAuthOperation aOperation )
       
   715     {
       
   716     __ASSERT_DEBUG( !IsActive(), User::Leave( KErrCorrupt ) );
       
   717     iPrFwId = aReqId;
       
   718     iOperation = aOperation;
       
   719     if ( !iXdmUtils )
       
   720         {
       
   721         iXdmUtils = iConnObs.XdmUtilsL();
       
   722         }
       
   723     if ( iXdmOk )
       
   724         {
       
   725         CallActualXdmOperationL();
       
   726         }
       
   727     else
       
   728         {
       
   729         iXdmUtils->InitializeXdmL( iStatus );
       
   730         SetActive();
       
   731         }
       
   732     }
       
   733 
       
   734 // ---------------------------------------------------------------------------
       
   735 // CSimplePluginAuthorization::HandleFullWinfoNotificationL
       
   736 // ---------------------------------------------------------------------------
       
   737 //
       
   738 void CSimplePluginAuthorization::HandleFullWinfoNotificationL(
       
   739     MSimpleWinfo& aWinfo )
       
   740     {
       
   741 
       
   742 #ifdef _DEBUG
       
   743     PluginLogger::Log(_L("PluginAuthorization: HandleFullWinfoNotificationL starts"));
       
   744 #endif
       
   745 
       
   746     // Search for pending watchers and call HandlePresenceGrantRequestListL
       
   747     using namespace NSimplePlugin::NSimpleOma;
       
   748 
       
   749     RPointerArray<MSimpleElement> elems;
       
   750     CleanupClosePushL( elems );
       
   751     TInt err = aWinfo.SimpleElementsL( elems );
       
   752     User::LeaveIfError( err );
       
   753     TInt count = elems.Count();
       
   754 
       
   755     MSimpleElement* elem = elems[0];
       
   756     TPtrC8 p8 = elem->LocalName();
       
   757     err = p8.CompareF( KSimpleWatcherList8 );
       
   758     User::LeaveIfError( err );
       
   759 
       
   760     err = elem->SimpleElementsL( elems );
       
   761     User::LeaveIfError( err );
       
   762     count = elems.Count();
       
   763 
       
   764     // Search watchers who are pending (status = pending)
       
   765     HBufC* nodeContent = NULL;
       
   766     MXIMPObjectCollection *pendings = iConnObs.ObjectFactory().NewObjectCollectionLC();
       
   767 
       
   768     TBool pendingFound(EFalse);
       
   769 
       
   770     for ( TInt i = 0; i < count; i++ )
       
   771         {
       
   772         elem = elems[i];
       
   773         p8.Set( elem->LocalName());
       
   774         if (!( p8.CompareF( KSimpleWatcher8 )))
       
   775             {
       
   776             const TDesC8* pp8 = elem->AttrValue( KSimpleStatus8 );
       
   777             if ( pp8 && !pp8->CompareF( KSimplePending8 ))
       
   778                 {
       
   779                 // Build collection of grant requests
       
   780                 // Find the child node containing the SIP entity
       
   781                 nodeContent = elem->ContentUnicodeL();
       
   782                 CleanupStack::PushL( nodeContent );
       
   783                 // create the collection entry here
       
   784                 MPresenceGrantRequestInfo* grInfo =
       
   785                    iConnObs.PresenceObjectFactory().NewPresenceGrantRequestInfoLC();
       
   786                 MXIMPIdentity* identity = iConnObs.ObjectFactory().NewIdentityLC();
       
   787                 identity->SetIdentityL( nodeContent->Des());
       
   788                 grInfo->SetRequestorIdL( identity ); // ownership is taken
       
   789                 CleanupStack::Pop( ); // identity
       
   790 #ifdef _DEBUG
       
   791                 TBuf<200> debug_buffer;
       
   792                 debug_buffer = nodeContent->Des();
       
   793                 PluginLogger::Log(
       
   794                     _L("PluginAuth: add pending into collection: %S"), &debug_buffer );
       
   795 #endif
       
   796                 pendings->AddObjectL( grInfo );  // ownership is taken
       
   797                 CleanupStack::Pop( );            // grInfo
       
   798                 pendingFound = ETrue;
       
   799                 CleanupStack::PopAndDestroy( nodeContent );
       
   800                 }
       
   801             }
       
   802         }
       
   803 
       
   804     if ( pendingFound )
       
   805         {
       
   806 #ifdef _DEBUG
       
   807         PluginLogger::Log(_L("PluginAuthorization: callback HandlePresenceGrantRequestListL"));
       
   808 #endif
       
   809         iPrFwIdOwn = iDataHost->HandlePresenceGrantRequestListL( pendings );
       
   810         CleanupStack::Pop();    // >> pendings
       
   811         }
       
   812     else
       
   813         {
       
   814         CleanupStack::PopAndDestroy( ); // >> pendings
       
   815         }
       
   816 
       
   817     CleanupStack::PopAndDestroy( &elems );
       
   818 
       
   819 #ifdef _DEBUG
       
   820     PluginLogger::Log(_L("PluginAuthorization: HandleFullWinfoNotificationL ends"));
       
   821 #endif
       
   822 
       
   823     /* example:
       
   824 
       
   825    <?xml version="1.0"?>
       
   826      <watcherinfo xmlns="urn:ietf:params:xml:ns:watcherinfo"
       
   827    version="0" state="full">
       
   828      <watcher-list resource="sip:presentity@example.com"
       
   829                    package="presence">
       
   830          <watcher status="active"
       
   831             id="sr8fdsj"
       
   832             duration-subscribed="509"
       
   833             expiration="20"
       
   834             event="approved">sip:watcherA@example.com"
       
   835           </watcher>
       
   836      */
       
   837     }
       
   838 
       
   839 // ---------------------------------------------------------------------------
       
   840 // CSimplePluginAuthorization::HandlePartialWinfoNotificationL
       
   841 // ---------------------------------------------------------------------------
       
   842 //
       
   843 void CSimplePluginAuthorization::HandlePartialWinfoNotificationL(
       
   844     MSimpleWinfo& aWinfo )
       
   845     {
       
   846 
       
   847 #ifdef _DEBUG
       
   848     PluginLogger::Log(_L("PluginAuthorization: HandlePartialWinfoNotificationL starts"));
       
   849 #endif
       
   850 
       
   851     using namespace NSimplePlugin::NSimpleOma;
       
   852 
       
   853     RPointerArray<MSimpleElement> elems;
       
   854     CleanupClosePushL( elems );
       
   855     TInt err = aWinfo.SimpleElementsL( elems );
       
   856     User::LeaveIfError( err );
       
   857     TInt count = elems.Count();
       
   858 
       
   859     MSimpleElement* elem = elems[0];
       
   860     TPtrC8 p8 = elem->LocalName();
       
   861     err = p8.CompareF( KSimpleWatcherList8 );
       
   862     User::LeaveIfError( err );
       
   863 
       
   864     err = elem->SimpleElementsL( elems );
       
   865     User::LeaveIfError( err );
       
   866     count = elems.Count();
       
   867 
       
   868     HBufC* nodeContent = NULL;
       
   869 
       
   870     for ( TInt i = 0; i < count; i++ )
       
   871         {
       
   872         elem = elems[i];
       
   873         p8.Set( elem->LocalName());
       
   874         if (!( p8.CompareF( KSimpleWatcher8 )))
       
   875             {
       
   876             const TDesC8* pp8 = elem->AttrValue( KSimpleStatus8 );
       
   877             if ( pp8 && !pp8->CompareF( KSimplePending8 ))
       
   878                 {
       
   879                 nodeContent = elem->ContentUnicodeL();
       
   880                 CleanupStack::PushL( nodeContent );
       
   881                 CallHandlePresenceGrantRequestReceivedL( nodeContent->Des() );
       
   882                 CleanupStack::PopAndDestroy( nodeContent );
       
   883                 }
       
   884             else if ( pp8 && !pp8->CompareF( KSimpleTerminated8 ))
       
   885                 {
       
   886                 nodeContent = elem->ContentUnicodeL();
       
   887                 CleanupStack::PushL( nodeContent );
       
   888                 CallHandlePresenceGrantRequestObsoletedL( nodeContent->Des() );
       
   889                 CleanupStack::PopAndDestroy( nodeContent );
       
   890                 }
       
   891             }
       
   892         }
       
   893     CleanupStack::PopAndDestroy( &elems );
       
   894 
       
   895 #ifdef _DEBUG
       
   896     PluginLogger::Log(_L("PluginAuthorization: HandlePartialWinfoNotificationL ends"));
       
   897 #endif
       
   898     }
       
   899 
       
   900 // ---------------------------------------------------------------------------
       
   901 // CSimplePluginAuthorization::CallHandlePresenceGrantRequestReceivedL
       
   902 // ---------------------------------------------------------------------------
       
   903 //
       
   904 void CSimplePluginAuthorization::CallHandlePresenceGrantRequestReceivedL(
       
   905     const TDesC& aUserId )
       
   906     {
       
   907     // create the collection entry here
       
   908     MPresenceGrantRequestInfo* grInfo =
       
   909        iConnObs.PresenceObjectFactory().NewPresenceGrantRequestInfoLC();  // +grInfo
       
   910     MXIMPIdentity* identity = iConnObs.ObjectFactory().NewIdentityLC();   // +identity
       
   911     identity->SetIdentityL( aUserId );
       
   912     grInfo->SetRequestorIdL( identity ); // ownership is taken
       
   913     CleanupStack::Pop( );    // -identity
       
   914 #ifdef _DEBUG
       
   915     PluginLogger::Log(_L("PluginAuthorization: callback HandlePresenceGrantRequestReceivedL"));
       
   916 #endif
       
   917     iPrFwIdOwn = iDataHost->HandlePresenceGrantRequestReceivedL( grInfo ); // ownership is taken
       
   918     CleanupStack::Pop( );           // -grInfo
       
   919     }
       
   920 
       
   921 // ---------------------------------------------------------------------------
       
   922 // CSimplePluginAuthorization::CallHandlePresenceGrantRequestObsoletedL
       
   923 // ---------------------------------------------------------------------------
       
   924 //
       
   925 void CSimplePluginAuthorization::CallHandlePresenceGrantRequestObsoletedL(
       
   926     const TDesC& aUserId)
       
   927     {
       
   928     MXIMPIdentity* identity = iConnObs.ObjectFactory().NewIdentityLC();
       
   929     identity->SetIdentityL( aUserId );
       
   930 #ifdef _DEBUG
       
   931     PluginLogger::Log(_L("PluginAuthorization: callback HandlePresenceGrantRequestObsoletedL"));
       
   932 #endif
       
   933     iPrFwIdOwn = iDataHost->HandlePresenceGrantRequestObsoletedL( identity); // ownership is taken
       
   934     CleanupStack::Pop( );           // >> identity
       
   935     }
       
   936 
       
   937 // ---------------------------------------------------------------------------
       
   938 // CSimplePluginAuthorization::HandleSubscribeBlockListL
       
   939 // ---------------------------------------------------------------------------
       
   940 //
       
   941 void CSimplePluginAuthorization::HandleSubscribeBlockListL()
       
   942     {
       
   943     RPointerArray<MXIMPIdentity> blockedSouls;
       
   944     CleanupClosePushL( blockedSouls );
       
   945 
       
   946     const TInt KMyGran = 10;
       
   947     CPtrCArray* blockers = new (ELeave) CPtrCArray( KMyGran );
       
   948     CleanupStack::PushL( blockers );      // << blockers
       
   949 
       
   950     iXdmUtils->SubscribeBlockListL( *blockers );
       
   951 
       
   952     CopyBlockersToArrayL( *blockers, blockedSouls );
       
   953 
       
   954     CleanupStack::PopAndDestroy( blockers );
       
   955 
       
   956     MXIMPObjectCollection* coll =
       
   957         iConnObs.ObjectFactory().NewObjectCollectionLC();    // << coll
       
   958     TInt count = blockedSouls.Count();
       
   959     for ( TInt i = count-1; i >= 0; i-- )
       
   960         {
       
   961         MXIMPIdentity* currId = blockedSouls[i];
       
   962         MPresenceBlockInfo* bInfo = iConnObs.PresenceObjectFactory().NewPresenceBlockInfoLC();
       
   963         bInfo->SetBlockedEntityIdL( currId ); // ownership is taken
       
   964         bInfo->SetBlockedEntityDisplayNameL( currId->Identity() );
       
   965         blockedSouls.Remove( i );
       
   966         coll->AddObjectL( bInfo );      // ownership is taken
       
   967         CleanupStack::Pop();                                // >> bInfo
       
   968         }
       
   969     CompletePrFwReq( KErrNone );
       
   970 #ifdef _DEBUG
       
   971     PluginLogger::Log(_L("PluginAuth: callback HandlePresenceBlockListL"));
       
   972 #endif
       
   973     // Callback for subscription result
       
   974     iDataHost->HandlePresenceBlockListL( coll );
       
   975 
       
   976     CleanupStack::Pop();                                // >> coll
       
   977     CleanupStack::PopAndDestroy( &blockedSouls );
       
   978 
       
   979     // Callback for subscription state (terminated).
       
   980     MXIMPDataSubscriptionState* myState = iConnObs.ObjectFactory().NewDataSubscriptionStateLC();
       
   981     MXIMPStatus* myStatus = iConnObs.ObjectFactory().NewStatusLC();
       
   982     // Notice: consider error codes
       
   983     myStatus->SetResultCode( KErrNone );
       
   984     myState->SetSubscriptionStateL(
       
   985         MXIMPDataSubscriptionState::ESubscriptionInactive );
       
   986 #ifdef _DEBUG
       
   987     PluginLogger::Log(_L("PluginAuthorization: callback SetPresenceBlockDataSubscriptionStateL"));
       
   988 #endif
       
   989     iDataHost->SetPresenceBlockDataSubscriptionStateL(
       
   990         myState, myStatus );
       
   991     CleanupStack::Pop( 2 ); // >> myState, myStatus
       
   992 
       
   993     }
       
   994 
       
   995 // ---------------------------------------------------------------------------
       
   996 // CSimplePluginAuthorization::CompletePrFwReq
       
   997 // ---------------------------------------------------------------------------
       
   998 //
       
   999 void CSimplePluginAuthorization::CompletePrFwReq( TInt aStatus )
       
  1000     {
       
  1001 #ifdef _DEBUG
       
  1002     PluginLogger::Log(_L("PluginAuthorization: CompletePrFwReq status=%d"), aStatus );
       
  1003 #endif
       
  1004     iOperation = ENoOperation;
       
  1005     iConnObs.CompleteReq( iPrFwId, aStatus  );
       
  1006     iPrFwId = TXIMPRequestId();
       
  1007     }
       
  1008 
       
  1009 // ---------------------------------------------------------------------------
       
  1010 // CSimplePluginAuthorization::HandleIfMine
       
  1011 // ---------------------------------------------------------------------------
       
  1012 //
       
  1013 TBool CSimplePluginAuthorization::HandleIfMine( TXIMPRequestId aReqId, TInt aStatus )
       
  1014     {
       
  1015 #ifdef _DEBUG
       
  1016     PluginLogger::Log(_L("PluginAuthorization: HandleIfMine aStatus=%d iOper=%d"), aStatus, iOperation);
       
  1017 #endif
       
  1018     TInt err = KErrNone;
       
  1019     TBool ret = EFalse;
       
  1020 
       
  1021     // We check wheter the request is made by this entity.
       
  1022     if ( iPrFwId != aReqId )
       
  1023         {
       
  1024         // Nothing to do, request was not orginated by this entity.
       
  1025         }
       
  1026     else
       
  1027         {
       
  1028         if ( !aStatus )
       
  1029             {
       
  1030             switch ( iOperation )
       
  1031                 {
       
  1032                 case ESubscribePresenceGrantRequestList:
       
  1033                     // Modify rule to CONFIRM
       
  1034 #ifdef _DEBUG
       
  1035                     PluginLogger::Log(_L("PluginAuthorization: HandleIfMine TEST COVERS 7"));
       
  1036 #endif
       
  1037                     TRAP( err, DoStartXdmOperationL( aReqId, iOperation ));
       
  1038                     err = CSimplePluginConnection::HarmonizeErrorCode( err );
       
  1039                     ret = ETrue;
       
  1040                     break;
       
  1041                 // In UnsubscribePresenceGrantRequestList case the rule modifcation
       
  1042                 // has been made first before SIP unsubscribe operation.
       
  1043                 case EUnsubscribePresenceGrantRequestList:
       
  1044                 default:
       
  1045                     iWinfoSubs = EFalse;
       
  1046                     break;
       
  1047                 }
       
  1048             }
       
  1049         else
       
  1050             {
       
  1051             CompletePrFwReq( err );
       
  1052             ret = ETrue;
       
  1053             }
       
  1054         if ( err )
       
  1055             {
       
  1056             CompletePrFwReq( err );
       
  1057             ret = ETrue;
       
  1058             }
       
  1059         else
       
  1060             {
       
  1061             }
       
  1062         }
       
  1063 
       
  1064 #ifdef _DEBUG
       
  1065     PluginLogger::Log(_L("PluginAuthorization: HandleIfMine returns %d"), ret );
       
  1066 #endif
       
  1067     return ret;
       
  1068     }
       
  1069 
       
  1070 // End of file
       
  1071