backends: apply PHOTO import/export scripts by default (Apple CardDAV)

A recent Apple Calendar server (correctly) rejects the invalid
PHOTO;TYPE=unknown: property in a vCard. This internal representation
must be cleared before serializing the field list. Done by using the
VCARD_OUTGOING_PHOTO_VALUE_SCRIPT by default for all backends which do
not set there own script. The Evolution backend already included the
script.

Likewise, check PHOTO data after reading from the backend by
default (VCARD_INCOMING_PHOTO_VALUE_SCRIPT).
This commit is contained in:
Patrick Ohly 2011-08-26 08:06:43 +00:00
parent 0c191d5a0d
commit d65ed40287
1 changed files with 8 additions and 0 deletions

View File

@ -558,6 +558,14 @@ void SyncSourceSerialize::getSynthesisInfo(SynthesisInfo &info,
info.m_datatypes =
" <use datatype='vCard21' mode='rw'/>\n"
" <use datatype='vCard30' mode='rw' preferred='yes'/>\n";
// If a backend overwrites the m_beforeWriteScript, then it must
// include $VCARD_OUTGOING_PHOTO_VALUE_SCRIPT in its own script,
// otherwise it will be sent invalid, empty PHOTO;TYPE=unknown;VALUE=binary:
// properties.
info.m_beforeWriteScript = "$VCARD_OUTGOING_PHOTO_VALUE_SCRIPT;\n";
// Likewise for reading. This is needed to ensure proper merging
// of contact data.
info.m_afterReadScript = "$VCARD_INCOMING_PHOTO_VALUE_SCRIPT;\n";
} else if (type == "text/x-calendar" || type == "text/x-vcalendar") {
info.m_native = "vCalendar10";
info.m_fieldlist = "calendar";