Skip to content

Commit

Permalink
Merge pull request #2000 from zlajo/remove_vcard_label_workaround
Browse files Browse the repository at this point in the history
Remove Workaround for Postal Addresses Containing Commas
  • Loading branch information
skjnldsv authored Jan 4, 2021
2 parents 4827216 + be4d5fc commit ada212c
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/services/updateDesignSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,6 @@
*/
import ICAL from 'ical.js'

/**
* Fixes nextcloud/contacts#1009 that prevented editing of contacts if
* their address contained a comma. This is actually a bug in ical.js
* but it has not been fixed for some time now.
*
* This can be removed once https://github.com/mozilla-comm/ical.js/issues/386
* has been resolved.
*
* @returns {Boolean} Whether or not the design set has been altered.
*/
const setLabelAsSingleValue = () => {
if (
!ICAL.design.vcard.param.label
|| ICAL.design.vcard.param.label.multiValue !== false
|| !ICAL.design.vcard3.param.label
|| ICAL.design.vcard3.param.label.multiValue !== false
) {
ICAL.design.vcard.param.label = { multiValue: false }
ICAL.design.vcard3.param.label = { multiValue: false }

return true
}

return false
}

/**
* Prevents ical.js from adding 'VALUE=PHONE-NUMBER' in vCard 3.0.
* While not wrong according to the RFC, there's a bug in sabreio/vobject (used
Expand Down Expand Up @@ -99,7 +73,6 @@ const addGroupedProperties = vCard => {
export default function(vCard) {
let madeChanges = false

madeChanges |= setLabelAsSingleValue()
madeChanges |= removePhoneNumberValueType()
madeChanges |= addGroupedProperties(vCard)

Expand Down

0 comments on commit ada212c

Please sign in to comment.