545 ) ; |
545 ) ; |
546 TRACE( T_LIT("CVIMPSTStorageServiceView::SetOwnUserIdL iOwnContact created") ); |
546 TRACE( T_LIT("CVIMPSTStorageServiceView::SetOwnUserIdL iOwnContact created") ); |
547 } |
547 } |
548 else if( aUserId.Compare( iOwnContact->UserId() ) != 0 ) |
548 else if( aUserId.Compare( iOwnContact->UserId() ) != 0 ) |
549 { |
549 { |
|
550 _LIT (KNullWithSpace, " "); |
550 TRACE( T_LIT("CVIMPSTStorageServiceView::SetOwnUserIdL iOwnContact was existing") ); |
551 TRACE( T_LIT("CVIMPSTStorageServiceView::SetOwnUserIdL iOwnContact was existing") ); |
|
552 if(KNullWithSpace ().Compare(iOwnContact->UserId())!=0) |
|
553 { |
|
554 iVPbkContactStore->RemoveAllVPbkContactsL(); // if user id is changed remove all contacts |
|
555 RemoveAllCacheContactsL(); |
|
556 } |
551 iOwnContact->SetUserIdL( aUserId ); |
557 iOwnContact->SetUserIdL( aUserId ); |
552 iOwnContact->SetAvatarContentL(KNullDesC8,*iVPbkContactStore ); |
558 iOwnContact->SetAvatarContentL(KNullDesC8,*iVPbkContactStore ); |
553 iVPbkContactStore->RemoveAllVPbkContactsL(); // if user id is changed remove all contacts |
559 |
554 NotifyAllObserversL( TVIMPSTEnums::EStorageEventOwnUserChanged,NULL,iOwnContact,0 ); |
560 NotifyAllObserversL( TVIMPSTEnums::EStorageEventOwnUserChanged,NULL,iOwnContact,0 ); |
555 TRACE( T_LIT("CVIMPSTStorageServiceView::SetOwnUserIdL NotifyAllObserversL delivered") ); |
561 TRACE( T_LIT("CVIMPSTStorageServiceView::SetOwnUserIdL NotifyAllObserversL delivered") ); |
556 } |
562 } |
557 TRACE( T_LIT("CVIMPSTStorageServiceView::SetOwnUserIdL end") ); |
563 TRACE( T_LIT("CVIMPSTStorageServiceView::SetOwnUserIdL end") ); |
558 } |
564 } |