From 991421c482ccf613e2857423d6ffe2e95a0041fb Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 29 Jun 2016 09:06:02 +0100 Subject: [PATCH] Added CLIENTPIDMAP to the SaveString function of ContactDataObject --- .../cdo/ContactDataObject-Save.cpp | 25 +++++++++++++++++++ source/tests/xestiaab_contactsave.h | 4 +++ 2 files changed, 29 insertions(+) diff --git a/source/contacteditor/cdo/ContactDataObject-Save.cpp b/source/contacteditor/cdo/ContactDataObject-Save.cpp index 4cc5a6f..3b12441 100644 --- a/source/contacteditor/cdo/ContactDataObject-Save.cpp +++ b/source/contacteditor/cdo/ContactDataObject-Save.cpp @@ -86,6 +86,31 @@ ContactSaveStatus ContactDataObject::SaveString(wxString *SaveData){ &SourceListMediatype, &SourceListPref, &SourceListTokens, SaveData); + // Process CLIENTPIDMAP. + + for (std::map::iterator CPIDIter = ClientPIDList.begin(); + CPIDIter != ClientPIDList.end(); CPIDIter++){ + + ProcessData.Append("CLIENTPIDMAP"); + + if (ClientPIDListTokens[CPIDIter->first].size() > 0){ + + ProcessData.Append(";"); + ProcessData.Append(ClientPIDListTokens[CPIDIter->first]); + + } + + ProcessData.Append(":"); + ProcessData.Append(CPIDIter->second); + ProcessData.Append("\n"); + + ProcessData = OutputText(&ProcessData); + + SaveData->Append(ProcessData); + ProcessData.clear(); + + } + // Process FN. for (std::map::iterator FNIter = FullNamesList.begin(); diff --git a/source/tests/xestiaab_contactsave.h b/source/tests/xestiaab_contactsave.h index 6ae4698..3eb41b1 100644 --- a/source/tests/xestiaab_contactsave.h +++ b/source/tests/xestiaab_contactsave.h @@ -68,6 +68,10 @@ TEST(ContactSave, ContactSaveTests){ " INE:http://example.com/source/sourceb.vcf\n" "SOURCE;TYPE=work;ALTID=94;MEDIATYPE=text/sandpaper;PID=91;PREF=92;STATUS=OFFL\n" " INE:http://example.com/source/sourcec.vcf\n" + "CLIENTPIDMAP:1;urn;uuid:aaaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa\n" + "CLIENTPIDMAP:2;urn;uuid:ccccccccc-cccc-cccc-cccc-cccccccccccc\n" + "CLIENTPIDMAP;MEEP=MOO;WOOP=WOO:3;urn;uuid:bbbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbb\n" + " bb\n" "FN;TYPE=work;LANGUAGE=kw;ALTID=500;PID=40;PREF=45;EXAMPLE=Baaa:Test Contact\n" "TITLE;ALTID=20;LANGUAGE=text/plain;PID=21;PREF=22;EEP=LIGHT:Lord of Light\n" "TITLE;TYPE=home;ALTID=30;LANGUAGE=grass/dry;PID=31;PREF=32;EEP=DARK:Lord of D\n" -- 2.39.5