Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added MEMBER to the SaveString function of ContactDataObject
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 2 Jul 2016 23:25:48 +0000 (00:25 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 2 Jul 2016 23:25:48 +0000 (00:25 +0100)
source/contacteditor/cdo/ContactDataObject-Save.cpp
source/contacteditor/cdo/ContactDataObject.h

index b78bdc0..191355f 100644 (file)
@@ -113,6 +113,17 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){
                &SourceListMediatype, &SourceListPref, 
                &SourceListTokens, SaveData);
        
+       // Process MEMBER (if contact kind is CONTACTKIND_GROUP).
+       
+       if (ContactKind == CONTACTKIND_GROUP){
+               
+               SaveMember(&GroupsList, &GroupsListAltID, 
+                       &GroupsListPID, &GroupsListType,
+                       &GroupsListMediaType, &GroupsListPref, 
+                       &GroupsListTokens, SaveData);
+               
+       }
+       
        // Process CLIENTPIDMAP.
        
        for (std::map<int, wxString>::iterator CPIDIter = ClientPIDList.begin();
@@ -799,6 +810,85 @@ void ContactDataObject::SaveSource(map<int, wxString> *SourceList, map<int, wxSt
                
 }
 
+void ContactDataObject::SaveMember(std::map<int, wxString> *GroupsList, std::map<int, wxString> *GroupsListAltID, 
+       std::map<int, wxString> *GroupsListPID, std::map<int, wxString> *GroupsListType,
+       std::map<int, wxString> *GroupsListMediaType, std::map<int, int> *GroupsListPref, 
+       std::map<int, wxString> *GroupsListTokens, wxString *SaveData){
+
+       wxString ProcessData = "";
+               
+       for (std::map<int, wxString>::iterator GroupsIter = GroupsList->begin();
+               GroupsIter != GroupsList->end(); GroupsIter++){
+
+               ProcessData.Append("MEMBER");
+                       
+               // Check if there is a value for TYPE.
+               
+               if ((*GroupsListType)[GroupsIter->first].size() > 0){
+               
+                       ProcessData.Append(";TYPE=");
+                       ProcessData.Append((*GroupsListType)[GroupsIter->first]);
+                       
+               }
+               
+               // Check if there is a value for ALTID.
+               
+               if ((*GroupsListAltID)[GroupsIter->first].size() > 0){
+               
+                       ProcessData.Append(";ALTID=");
+                       ProcessData.Append((*GroupsListAltID)[GroupsIter->first]);
+                       
+               }
+
+               // Check if there is a value for MEDIATYPE.
+               
+               if ((*GroupsListMediaType)[GroupsIter->first].size() > 0){
+               
+                       ProcessData.Append(";MEDIATYPE=");
+                       ProcessData.Append((*GroupsListMediaType)[GroupsIter->first]);
+                       
+               }
+               
+               // Check if there is a value for PID.
+
+               if ((*GroupsListPID)[GroupsIter->first].size() > 0){
+               
+                       ProcessData.Append(";PID=");
+                       ProcessData.Append((*GroupsListPID)[GroupsIter->first]);
+                       
+               }
+
+               // Check if there is a value for PREF.
+
+               if ((*GroupsListPref)[GroupsIter->first] > 0){
+               
+                       ProcessData.Append(";PREF=");
+                       ProcessData.Append(wxString::Format("%i", (*GroupsListPref)[GroupsIter->first]));
+                       
+               }
+
+               // Check if there is a value for tokens.
+
+               if ((*GroupsListTokens)[GroupsIter->first].size() > 0){
+               
+                       ProcessData.Append(";");
+                       ProcessData.Append((*GroupsListTokens)[GroupsIter->first]);
+                       
+               }
+                       
+               ProcessData.Append(":");
+               ProcessData.Append(GroupsIter->second);
+               ProcessData.Append("\n");
+
+               ProcessData = OutputText(&ProcessData);
+               
+               SaveData->Append(ProcessData);
+               ProcessData.clear();
+                       
+       }
+               
+}
+
 void ContactDataObject::SaveNickname(map<int, wxString> *NicknameList, map<int, wxString> *NicknameListAltID, 
        map<int, wxString> *NicknameListPID, map<int, wxString> *NicknameListType,
        map<int, wxString> *NicknameListLanguage, map<int, int> *NicknameListPref, 
index 24451f1..b6ef1ba 100644 (file)
@@ -106,6 +106,10 @@ class ContactDataObject{
                map<int, wxString> *SourceListPID, map<int, wxString> *SourceListType,
                map<int, wxString> *SourceListMediatype, map<int, int> *SourceListPref, 
                map<int, wxString> *SourceListTokens, wxString *SaveData);
+       void SaveMember(std::map<int, wxString> *GroupsList, std::map<int, wxString> *GroupsListAltID, 
+               std::map<int, wxString> *GroupsListPID, std::map<int, wxString> *GroupsListType,
+               std::map<int, wxString> *GroupsListMediatype, std::map<int, int> *GroupsListPref, 
+               std::map<int, wxString> *GroupsListTokens, wxString *SaveData);         
        void SaveNickname(map<int, wxString> *NicknameList, map<int, wxString> *NicknameListAltID, 
                map<int, wxString> *NicknameListPID, map<int, wxString> *NicknameListType,
                map<int, wxString> *NicknameListLanguage, map<int, int> *NicknameListPref, 
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