Revision: 201013 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 14 Apr 2010 16:22:17 +0300
branchRCL_3
changeset 8 b4758b4b2d20
parent 7 96b99892dd80
child 9 de84881f4ac3
Revision: 201013 Kit: 201015
XDMSettingsUI/group/XDMPlugin.mmp
XDMSettingsUI/src/XDMPluginSLContainer.cpp
presencesettingsui/src/psuigspluginsettingviewcontainer.cpp
simpledatamodeladapter/group/presenceplugin.mmp
simpledatamodeladapter/inc/presencepluginauthorization.h
simpledatamodeladapter/src/presencepluginauthorization.cpp
simpledatamodeladapter/src/presenceplugindata.cpp
simpledatamodeladapter/src/presensepluginlocalstore.cpp
--- a/XDMSettingsUI/group/XDMPlugin.mmp	Wed Mar 31 22:15:41 2010 +0300
+++ b/XDMSettingsUI/group/XDMPlugin.mmp	Wed Apr 14 16:22:17 2010 +0300
@@ -77,6 +77,7 @@
 
 LIBRARY		        featmgr.lib // Feature Manager
 LIBRARY		        hlplch.lib // HlpLauncher
+LIBRARY             inetprotutil.lib // conversions
 
 // This is optional - used only by Codewarrior for convenience.
 DOCUMENT            10207428.rss
--- a/XDMSettingsUI/src/XDMPluginSLContainer.cpp	Wed Mar 31 22:15:41 2010 +0300
+++ b/XDMSettingsUI/src/XDMPluginSLContainer.cpp	Wed Apr 14 16:22:17 2010 +0300
@@ -36,6 +36,7 @@
 #include    <AknQueryDialog.h>
 #include    <aknnotewrappers.h>
 #include    <aknnotedialog.h>
+#include    <escapeutils.h>
 
 #include    "XDMPluginSLContainer.h"
 #include    "XDMPluginSettinglist.h"
@@ -234,8 +235,31 @@
         {
         iData->iAccessPoint = -1;
         }
-
-    iData->iUserID = xDMSet->Property(EXdmPropAuthName);
+    
+    TBuf<KMaxUserIDLength> username = xDMSet->Property( EXdmPropAuthName );
+    
+    // to show special chars in UI correctly
+    _LIT( KProcent, "%" );
+    if ( username.Find( KProcent ) != KErrNotFound )
+        {
+        // convert to 8 bit
+        HBufC8* tmp = HBufC8::NewLC( username.Length() );
+        tmp->Des().Copy( username );
+        
+        // Decode encoded username
+        HBufC8* decodedUsername = EscapeUtils::EscapeDecodeL( *tmp );
+        CleanupStack::PopAndDestroy( tmp );
+        CleanupStack::PushL( decodedUsername );
+        
+        // convert to unicode
+        HBufC* userName16 =
+             EscapeUtils::ConvertToUnicodeFromUtf8L( decodedUsername->Des() );
+        CleanupStack::PopAndDestroy( decodedUsername );        
+        username = userName16->Des();
+        delete userName16;
+        }
+    
+    iData->iUserID = username;
     iData->iPassword = xDMSet->Property(EXdmPropAuthSecret);
     
     CleanupStack::PopAndDestroy(1); //xDMSet
--- a/presencesettingsui/src/psuigspluginsettingviewcontainer.cpp	Wed Mar 31 22:15:41 2010 +0300
+++ b/presencesettingsui/src/psuigspluginsettingviewcontainer.cpp	Wed Apr 14 16:22:17 2010 +0300
@@ -32,6 +32,8 @@
 #include "psuigsplugin.h"
 #include "psuigspluginids.hrh"
 #include <csxhelp/pre.hlp.hrh>
+#include <AknTextSettingPage.h>
+
 
 // ========================= MEMBER FUNCTIONS ================================
 
@@ -111,10 +113,14 @@
         case EPSUIMaxSubscriptionsId:
             settingItem = new (ELeave) CPSUIIntegerSettingItem(
                 aSettingId, settingSet.iMaxSubscriptions );
+            settingItem->SetSettingPageFlags(
+                    CAknIntegerSettingPage::EEmptyValueAllowed);// Empty input allowed      
             break;
         case EPSUIMaxContactsInListId:
             settingItem = new (ELeave) CPSUIIntegerSettingItem( 
                 aSettingId, settingSet.iMaxContactsInList );
+            settingItem->SetSettingPageFlags(
+                    CAknIntegerSettingPage::EEmptyValueAllowed);// Empty input allowed      
             break;
         case EPSUIDomainSyntaxId:
             settingItem = new (ELeave) CAknTextSettingItem( 
@@ -140,6 +146,8 @@
 
     // update setting to setting-object
     (*SettingItemArray())[aIndex]->StoreL();
+    (*SettingItemArray())[aIndex]->UpdateListBoxTextL();
+    ListBox()->DrawNow();
     
     if ( EPSUIServerNameId == aIndex )
         {
--- a/simpledatamodeladapter/group/presenceplugin.mmp	Wed Mar 31 22:15:41 2010 +0300
+++ b/simpledatamodeladapter/group/presenceplugin.mmp	Wed Apr 14 16:22:17 2010 +0300
@@ -94,5 +94,6 @@
 
 // access to Virtual Phonebook contact database
 LIBRARY         vpbkeng.lib
+LIBRARY     inetprotutil.lib 
 
 // End of file
--- a/simpledatamodeladapter/inc/presencepluginauthorization.h	Wed Mar 31 22:15:41 2010 +0300
+++ b/simpledatamodeladapter/inc/presencepluginauthorization.h	Wed Apr 14 16:22:17 2010 +0300
@@ -79,7 +79,8 @@
             EStateDoUnBlock,
             EStatePresenceGranted,
             EStateRemovePresentityFromGranted,
-            EStateAcceptBuddyRequest
+            EStateAcceptBuddyRequest,
+            EStateSubscribe
             };
         
         /**
--- a/simpledatamodeladapter/src/presencepluginauthorization.cpp	Wed Mar 31 22:15:41 2010 +0300
+++ b/simpledatamodeladapter/src/presencepluginauthorization.cpp	Wed Apr 14 16:22:17 2010 +0300
@@ -509,8 +509,22 @@
                 identity->SetIdentityL( iPresIdentity->Des() ); 
                 iConnObs.WatcherHandlerL()->DoPerformSubscribePresentityPresenceL( *identity, iStatus );
                 CleanupStack::PopAndDestroy( ); //identity 
+                iAuthState = EStateSubscribe;
+                SetActive();
+                }
+                break;
+                
+            case EStateSubscribe:
+                {
+                DP_SDA( "CPresencePluginAuthorization::RunL -UnBlock completed" ); 
+                HBufC* withoutPrefix = iPresenceData->RemovePrefixLC( *iPresIdentity );
+                iPresenceData->WriteStatusToCacheL( *withoutPrefix, 
+                    MPresenceBuddyInfo2::ENotAvailable,
+                    KInvisibleState(),
+                    KNullDesC() );
+                CleanupStack::PopAndDestroy( withoutPrefix );
                 iAuthState = EStateIdle;
-                SetActive();
+                CompleteXIMPReq( myStatus );
                 }
                 break;
                 
--- a/simpledatamodeladapter/src/presenceplugindata.cpp	Wed Mar 31 22:15:41 2010 +0300
+++ b/simpledatamodeladapter/src/presenceplugindata.cpp	Wed Apr 14 16:22:17 2010 +0300
@@ -48,7 +48,7 @@
 #include <spdefinitions.h>
 #include <avabilitytext.h>
 #include <cvimpstsettingsstore.h>
-
+#include <escapeutils.h>
 
 #include "presenceplugindata.h"
 #include "presenceplugincommon.h"
@@ -1460,7 +1460,22 @@
 
     TBool updateCache( ETrue );
     
-    HBufC* cacheUri = ResolveCacheXspIdentifierL( aPresentityId );
+    // Decode encoded username (spaces to %20).
+    HBufC* decodedUsername = EscapeUtils::EscapeDecodeL( aPresentityId );
+    CleanupStack::PushL( decodedUsername );
+    
+    // convert to 8 bit version
+    HBufC8* tmp = HBufC8::NewLC( decodedUsername->Length() );
+    tmp->Des().Copy( *decodedUsername );
+    
+    // convert to unicode
+    HBufC* userName16 =
+            EscapeUtils::ConvertToUnicodeFromUtf8L( tmp->Des() );
+    
+    HBufC* cacheUri = ResolveCacheXspIdentifierL( userName16->Des() );
+    CleanupStack::PopAndDestroy( tmp );
+    CleanupStack::PopAndDestroy( decodedUsername );
+    delete userName16;
     CleanupStack::PushL( cacheUri );
     
     DP_SDA(" -> WriteStatusToCacheL - read previous values from cache"); 
--- a/simpledatamodeladapter/src/presensepluginlocalstore.cpp	Wed Mar 31 22:15:41 2010 +0300
+++ b/simpledatamodeladapter/src/presensepluginlocalstore.cpp	Wed Apr 14 16:22:17 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 
-#include <aknutils.h>
+#include <AknUtils.h>
 #include "presencepluginlocalstore.h"
 #include "presencelogger.h"