1425 } |
1425 } |
1426 break; |
1426 break; |
1427 } |
1427 } |
1428 case ECmdBlockContact: |
1428 case ECmdBlockContact: |
1429 { |
1429 { |
|
1430 TRACE("block finished enter"); |
1430 //blockcontact command is complete |
1431 //blockcontact command is complete |
1431 //use aCommand.Result() to get the data |
1432 //use aCommand.Result() to get the data |
1432 //Ownership is not given to the caller |
1433 //Ownership is not given to the caller |
1433 //some error occured. |
1434 //some error occured. |
1434 if(iWaitNote) |
1435 if(iWaitNote) |
1436 delete iWaitNote; |
1437 delete iWaitNote; |
1437 iWaitNote = NULL; |
1438 iWaitNote = NULL; |
1438 } |
1439 } |
1439 if(aCommand.Result() != KErrNone) |
1440 if(aCommand.Result() != KErrNone) |
1440 { |
1441 { |
|
1442 TRACE( "aCommand result = %d ", aCommand.Result() ); |
1441 HBufC* prompt = NULL; |
1443 HBufC* prompt = NULL; |
1442 prompt = StringLoader::LoadLC( R_QTN_CHAT_BLOCKING_FAILED ); |
1444 prompt = StringLoader::LoadLC( R_QTN_CHAT_BLOCKING_FAILED ); |
|
1445 TRACE("blocking error prompt displaying"); |
1443 TInt ret( VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt ) ); |
1446 TInt ret( VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt ) ); |
1444 CleanupStack::PopAndDestroy(prompt); |
1447 CleanupStack::PopAndDestroy(prompt); |
1445 } |
1448 } |
1446 break; |
1449 break; |
1447 } |
1450 } |
1448 case ECmdUnBlockContact: |
1451 case ECmdUnBlockContact: |
1449 { |
1452 { |
|
1453 TRACE("unblock finished enter"); |
|
1454 |
1450 if(iWaitNote) |
1455 if(iWaitNote) |
1451 { |
1456 { |
1452 delete iWaitNote; |
1457 delete iWaitNote; |
1453 iWaitNote = NULL; |
1458 iWaitNote = NULL; |
1454 } |
1459 } |
1456 //use aCommand.Result() to get the data |
1461 //use aCommand.Result() to get the data |
1457 //Ownership is not given to the caller |
1462 //Ownership is not given to the caller |
1458 //some error occured. |
1463 //some error occured. |
1459 if(aCommand.Result() != KErrNone) |
1464 if(aCommand.Result() != KErrNone) |
1460 { |
1465 { |
|
1466 TRACE( "aCommand result = %d ", aCommand.Result() ); |
1461 HBufC* prompt = NULL; |
1467 HBufC* prompt = NULL; |
1462 prompt = StringLoader::LoadLC( R_QTN_CHAT_UNBLOCKING_FAILED ); |
1468 prompt = StringLoader::LoadLC( R_QTN_CHAT_UNBLOCKING_FAILED ); |
|
1469 TRACE("unblocking error prompt displaying"); |
1463 TInt ret( VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt ) ); |
1470 TInt ret( VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt ) ); |
1464 CleanupStack::PopAndDestroy(prompt); |
1471 CleanupStack::PopAndDestroy(prompt); |
1465 } |
1472 } |
|
1473 else |
|
1474 { |
|
1475 TRACE("unblocking successful"); |
|
1476 |
|
1477 if(iContainer) |
|
1478 { |
|
1479 TInt index = CurrentItemIndex(); |
|
1480 if( index > 0 ) |
|
1481 { |
|
1482 MVIMPSTProcessArray& arrayprocess = iCommandHandler.GetProcessInterface(); |
|
1483 HBufC* contactId = arrayprocess.GetItemUserId(index).AllocLC(); |
|
1484 if( contactId->Length() ) |
|
1485 { |
|
1486 TRACE("HandleAvatarRefreshl calling for unblock"); |
|
1487 iContainer->HandleAvatarRefreshL(*contactId,EFalse); |
|
1488 |
|
1489 } |
|
1490 } |
|
1491 CleanupStack::PopAndDestroy(); |
|
1492 } |
|
1493 } |
1466 break; |
1494 break; |
1467 } |
1495 } |
1468 default: |
1496 default: |
1469 { |
1497 { |
1470 //should never be here. |
1498 //should never be here. |
3591 iCommandHandler.HandleCommandL(ECmdBlockContact, this, contactId ); |
3619 iCommandHandler.HandleCommandL(ECmdBlockContact, this, contactId ); |
3592 CleanupStack::PopAndDestroy();// prompt |
3620 CleanupStack::PopAndDestroy();// prompt |
3593 |
3621 |
3594 if(iContainer) |
3622 if(iContainer) |
3595 { |
3623 { |
|
3624 TRACE("HandleAvatarRefreshl calling for blocking"); |
3596 |
3625 |
3597 iContainer->HandleAvatarDeleteL(*contactId); |
3626 iContainer->HandleAvatarRefreshL(*contactId, ETrue); |
3598 } |
3627 } |
3599 } |
3628 } |
3600 else |
3629 else |
3601 { |
3630 { |
3602 HBufC* unBprompt = StringLoader::LoadLC( R_QTN_CHAT_UNBLOCKING, *contactId ); |
3631 HBufC* unBprompt = StringLoader::LoadLC( R_QTN_CHAT_UNBLOCKING, *contactId ); |