Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Updated IMPP and TEL support.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 6 Jan 2016 18:04:46 +0000 (18:04 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 6 Jan 2016 18:04:46 +0000 (18:04 +0000)
source/contacteditor/cdo/ContactDataObject.cpp
source/contacteditor/cdo/ContactDataObject.h

index 1a6e6be..cda6933 100644 (file)
@@ -1875,7 +1875,8 @@ void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2,
        std::map<int, wxString> *IMListAltID = NULL;
        std::map<int, wxString> *IMListPID = NULL;
        std::map<int, wxString> *IMListTokens = NULL;
-       std::map<int, wxString> *IMListMediatype = NULL;        
+       std::map<int, wxString> *IMListMediatype = NULL;
+       std::map<int, wxString> *IMListTypeInfo = NULL;
        std::map<int, int> *IMListPref = NULL;
 
        switch(PropType){
@@ -1886,6 +1887,7 @@ void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2,
                        IMListPID = &GeneralIMListPID;
                        IMListTokens = &GeneralIMListTokens;
                        IMListMediatype = &GeneralIMListMediatype;
+                       IMListTypeInfo = &GeneralIMListTypeInfo;
                        IMListPref = &GeneralIMListPref;        
                        break;
                case PROPERTY_HOME:
@@ -1894,7 +1896,8 @@ void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2,
                        IMListAltID = &HomeIMListAltID;
                        IMListPID = &HomeIMListPID;
                        IMListTokens = &HomeIMListTokens;
-                       IMListMediatype = &HomeIMListMediatype;         
+                       IMListMediatype = &HomeIMListMediatype; 
+                       IMListTypeInfo = &HomeIMListTypeInfo;   
                        IMListPref = &HomeIMListPref;   
                        break;
                case PROPERTY_WORK:
@@ -1903,7 +1906,8 @@ void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2,
                        IMListAltID = &BusinessIMListAltID;
                        IMListPID = &BusinessIMListPID;
                        IMListTokens = &BusinessIMListTokens;   
-                       IMListMediatype = &BusinessIMListMediatype;     
+                       IMListMediatype = &BusinessIMListMediatype;
+                       IMListTypeInfo = &BusinessIMListTypeInfo;
                        IMListPref = &BusinessIMListPref;       
                        break;
        }
@@ -1946,7 +1950,19 @@ void ContactDataObject::ProcessIM(wxString PropertySeg1, wxString PropertySeg2,
        
        }
                
-       IMList->insert(std::make_pair(*IMCount, PropertySeg2));
+       wxStringTokenizer IMPPSplitData(PropertySeg2, wxT(":"));
+               
+       if (IMPPSplitData.CountTokens() > 1){
+
+               IMListTypeInfo->insert(std::make_pair(*IMCount, IMPPSplitData.GetNextToken()));
+               IMList->insert(std::make_pair(*IMCount, IMPPSplitData.GetString()));
+       
+       } else {
+       
+               IMList->insert(std::make_pair(*IMCount, PropertySeg2));
+               IMListTypeInfo->insert(std::make_pair(*IMCount, "none"));
+       
+       }
        
        // Add the name token data.
        
@@ -2061,7 +2077,7 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert
                
                        for (std::map<int, int>::iterator typeiter = TypeSplitPoints.begin(); 
                        typeiter != TypeSplitPoints.end(); ++typeiter){
-                       
+                                               
                                wxString TypePropertyName;
                                
                                TSLiter = TypeSplitLength.find(typeiter->first);
@@ -2076,7 +2092,7 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert
                                        TelTypeUI.Append(wxT(","));                                                     
                                
                                }
-                       
+
                                if (TypePropertyName == wxT("home")){
                                
                                        PropType = PROPERTY_HOME;
@@ -2105,7 +2121,7 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert
                                
                                } else if (TypePropertyName == wxT("cell")){
                                
-                                       TelTypeUI.Append(_("mobile"));
+                                       TelTypeUI.Append(_("cell"));
                                        intTypeSeek++;
                                
                                } else if (TypePropertyName == wxT("video")){
@@ -2136,7 +2152,8 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert
        std::map<int, wxString> *TelephoneListAltID = NULL;
        std::map<int, wxString> *TelephoneListPID = NULL;
        std::map<int, wxString> *TelephoneListTokens = NULL;
-       std::map<int, wxString> *TelephoneListTypeInfo = NULL;  
+       std::map<int, wxString> *TelephoneListTypeInfo = NULL;
+       std::map<int, wxString> *TelephoneListDataType = NULL;
        std::map<int, int> *TelephoneListPref = NULL;
 
        switch(PropType){
@@ -2147,6 +2164,7 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert
                        TelephoneListPID = &GeneralTelephoneListPID;
                        TelephoneListTokens = &GeneralTelephoneListTokens;
                        TelephoneListTypeInfo = &GeneralTelephoneListTypeInfo;
+                       TelephoneListDataType = &GeneralTelephoneListDataType;
                        TelephoneListPref = &GeneralTelephoneListPref;  
                        break;
                case PROPERTY_HOME:
@@ -2155,7 +2173,8 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert
                        TelephoneListAltID = &HomeTelephoneListAltID;
                        TelephoneListPID = &HomeTelephoneListPID;
                        TelephoneListTokens = &HomeTelephoneListTokens;
-                       TelephoneListTypeInfo = &HomeTelephoneListTypeInfo;     
+                       TelephoneListTypeInfo = &HomeTelephoneListTypeInfo;
+                       TelephoneListDataType = &HomeTelephoneListDataType;
                        TelephoneListPref = &HomeTelephoneListPref;     
                        break;
                case PROPERTY_WORK:
@@ -2164,7 +2183,8 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert
                        TelephoneListAltID = &BusinessTelephoneListAltID;
                        TelephoneListPID = &BusinessTelephoneListPID;
                        TelephoneListTokens = &BusinessTelephoneListTokens;     
-                       TelephoneListTypeInfo = &BusinessTelephoneListTypeInfo; 
+                       TelephoneListTypeInfo = &BusinessTelephoneListTypeInfo;
+                       TelephoneListDataType = &BusinessTelephoneListDataType;
                        TelephoneListPref = &BusinessTelephoneListPref; 
                        break;
        }
@@ -2210,9 +2230,24 @@ void ContactDataObject::ProcessTelephone(wxString PropertySeg1, wxString Propert
        
        }
                
-       TelephoneList->insert(std::make_pair(*TelephoneCount, PropertySeg2));
-       TelephoneListTypeInfo->insert(std::make_pair(*TelephoneCount, TelTypeUI));
+       // Check for the type information and split it down.
+       
+       wxStringTokenizer TelSplitData(PropertySeg2, wxT(":"));
+               
+       if (TelSplitData.CountTokens() > 1){
+
+               TelephoneListDataType->insert(std::make_pair(*TelephoneCount, TelSplitData.GetNextToken()));                    
+               TelephoneList->insert(std::make_pair(*TelephoneCount, TelSplitData.GetString()));
+       
+       } else {
        
+               TelephoneList->insert(std::make_pair(*TelephoneCount, PropertySeg2));
+               TelephoneListDataType->insert(std::make_pair(*TelephoneCount, "tel"));
+       
+       }
+               
+       TelephoneListTypeInfo->insert(std::make_pair(*TelephoneCount, TelTypeUI));
+               
        // Add the name token data.
        
        if (!PropertyTokens.IsEmpty()){
index 46edb7e..c481f8d 100644 (file)
@@ -194,6 +194,7 @@ class ContactDataObject{
        std::map<int, wxString> GeneralTelephoneListType;
        std::map<int, wxString> GeneralTelephoneListTokens;
        std::map<int, wxString> GeneralTelephoneListTypeInfo;
+       std::map<int, wxString> GeneralTelephoneListDataType;
        std::map<int, int> GeneralTelephoneListPref;
        
        std::map<int, wxString> GeneralLanguageList;
@@ -317,6 +318,7 @@ class ContactDataObject{
        std::map<int, wxString> HomeTelephoneListType;
        std::map<int, wxString> HomeTelephoneListTokens;
        std::map<int, wxString> HomeTelephoneListTypeInfo;
+       std::map<int, wxString> HomeTelephoneListDataType;
        std::map<int, int> HomeTelephoneListPref;
        
        std::map<int, wxString> HomeLanguageList;
@@ -431,6 +433,7 @@ class ContactDataObject{
        std::map<int, wxString> BusinessTelephoneListType;
        std::map<int, wxString> BusinessTelephoneListTypeInfo;
        std::map<int, wxString> BusinessTelephoneListTokens;
+       std::map<int, wxString> BusinessTelephoneListDataType;
        std::map<int, int> BusinessTelephoneListPref;
        
        std::map<int, wxString> BusinessLanguageList;
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy