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

Vcard convert #505

Merged
merged 13 commits into from
Aug 22, 2014
Merged

Vcard convert #505

merged 13 commits into from
Aug 22, 2014

Conversation

evert
Copy link
Member

@evert evert commented Aug 21, 2014

Work in progress.

  • Listening to Accept headers
  • Converting to vCard 3.0, 4.0, jCard on GET
  • Updating supported-address-data
  • Converting from jCard from PUT
  • Supporting new formats in REPORT
  • All new code unittested


}

$response->setBody($newBody);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case no case above matches, this var will be undefined

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true, but that path can also never be taken in the source. I could remove the is_null($result) and add the default : clause though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done ;)

*/
public function httpAfterGet(RequestInterface $request, ResponseInterface $response) {

if (strpos($response->getHeader('Content-Type'),'text/vcard')===false) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work for vcard+json

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And x+vcard

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true.. The assumption as of right now is that Sabre\CardDAV\Card always emits plain-old vcard blobs. This is sort of the assumption everywhere, including the backend classes.

The only 'layer' where there may be other formats, is the Plugin. The plugin is responsible to convert from and to jCard (and in the future xCard).

It will do this with incoming cards and here with outgoing cards. I can see myself wanting to also support jCard in the node/backend side in the future, but it's not the case yet.

So for now, it's just a conversion layer. Nothing changes for the implementer.

evert added a commit that referenced this pull request Aug 22, 2014
@evert evert merged commit cde96c3 into master Aug 22, 2014
@evert evert deleted the vcard-convert branch August 22, 2014 22:48
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

Successfully merging this pull request may close these issues.

2 participants