Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manually adding a vCard to Sabre CardDAV #1393

Open
webscopeny opened this issue Feb 23, 2022 · 0 comments
Open

Manually adding a vCard to Sabre CardDAV #1393

webscopeny opened this issue Feb 23, 2022 · 0 comments

Comments

@webscopeny
Copy link

We have installed Sabre on Centos 7 and it's working well

We're trying to manually add a contact to Sabre. I know this may be frowned upon, but after looking at the libraries, I feel we have it figured out. The only problem is that Thunderbird Address Book isn't syncing the newly added card. Any help would be appreciated

Sample created vCard saved as variable $carddata:
(We also tried converting the vCard to Version 3.0)

BEGIN:VCARD
VERSION:4.0
PRODID:-//Sabre//Sabre VObject 4.2.2//EN
UID:sabre-vobject-6909c955-72b1-4eae-8400-231b611d7b64
EMAIL:[email protected]
FN:John Smith
TITLE:President
END:VCARD

** Define fields:

$size=strlen($carddata)
$etag=md5($carddata)
$uri="$etag.vcf"

** Insert fields into "cards" table:

addressbookid: 1
carddata: $carddata
uri: $uri
lastmodified: Now
Size: $size

** Get synctoken field $synctoken from "addressbooks" record

** Insert fields into table "addressbookchanges":

uri: $uri
synctoken: $synctoken
addressbookid: 1
operation: 1

** Increment synctoken by one (synctoken=synctoken+1) in addressbooks table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant