Skip to content

Commit fba5432

Browse files
committed
fix: rendering of phone numbers
There was a bug in sabre/vobject that stopped us from storing URIs with phone numbers. So, we had to use a workaround and not include them.[^1] The fix for sabre/vobject is merged and included in stable31 and stable30.[^2] It seems like this problem started after updating to ical.js 2.2.0 because of fixes in how vcard3 design sets were detected.[^3][^4] Now it seems to work, but I don't understand why removing the tel property from the vcard3 design set worked when detecting the design set wasn't working before. [^1]: #1393 (comment) [^2]: sabre-io/vobject#486 [^3]: kewisch/ical.js#680 [^4]: kewisch/ical.js#363 Signed-off-by: Daniel Kesselberg <[email protected]>
1 parent fc4496b commit fba5432

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

src/services/updateDesignSet.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,6 @@
44
*/
55
import ICAL from 'ical.js'
66

7-
/**
8-
* Prevents ical.js from adding 'VALUE=PHONE-NUMBER' in vCard 3.0.
9-
* While not wrong according to the RFC, there's a bug in sabreio/vobject (used
10-
* by Nextcloud Server) that prevents saving vCards with this parameters.
11-
*
12-
* @link https://github.com/nextcloud/contacts/pull/1393#issuecomment-570945735
13-
* @return {boolean} Whether or not the design set has been altered.
14-
*/
15-
const removePhoneNumberValueType = () => {
16-
if (ICAL.design.vcard3.property.tel) {
17-
delete ICAL.design.vcard3.property.tel
18-
return true
19-
}
20-
21-
return false
22-
}
23-
247
/**
258
* Some clients group properties by naming them something like 'ITEM1.URL'.
269
* These should be treated the same as their original (i.e. 'URL' in this
@@ -78,7 +61,6 @@ export default function(vCard) {
7861
let madeChanges = false
7962

8063
madeChanges |= setTypeMultiValueSeparateDQuote()
81-
madeChanges |= removePhoneNumberValueType()
8264
madeChanges |= addGroupedProperties(vCard)
8365

8466
return madeChanges

0 commit comments

Comments
 (0)