-
Notifications
You must be signed in to change notification settings - Fork 344
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
Vcard convert #505
Conversation
|
||
} | ||
|
||
$response->setBody($newBody); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And x+vcard
There was a problem hiding this comment.
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.
Work in progress.
GET
PUT
REPORT