-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Contacts API: replace raw image data with url #25081
Conversation
By analyzing the blame information on this pull request, we identified @schiessle, @DeepDiver1975 and @nickvergessen to be potential reviewers |
dafd43b
to
e6d7a08
Compare
|
||
return [ | ||
'routes' => [ | ||
['name' => 'photos#get', 'url' => '/contactsphoto/{addressbookId}/{contactUri}', 'verb' => 'GET'], |
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.
hmmm ... I would have built this as part of the webdav routes
please note there are only 2 public http based protocols we support: webdav and ocs api.
routes like above are considered private and should not be exposed to 3rdparty - the mail and contacts apps are treated as 3rdparty
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.
I'm not so sure about the webdav route, because this change only affects the PHP based Contacts API. Adding this to the WebDAV routes would require apps like the Mail app to implement a dav client just to fetch contact images 😕
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.
Adding this to the WebDAV routes would require apps like the Mail app to implement a dav client just to fetch contact images 😕
A GET is a GET is a GET .... 🙊
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.
A GET is a GET is a GET ....
Well, there is some truth to this 🙈
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.
Is there some "easy" straight forward way to register routes or do I need to write a plugin like in https://github.com/owncloud/core/blob/master/apps/dav/lib/Comments/CommentsPlugin.php#L86?
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.
here we go ... #25121
e6d7a08
to
2858111
Compare
37c6655
to
77399b8
Compare
@@ -103,6 +104,7 @@ public function __construct(IRequest $request, $baseUri) { | |||
// addressbook plugins | |||
$this->server->addPlugin(new \OCA\DAV\CardDAV\Plugin()); | |||
$this->server->addPlugin(new VCFExportPlugin()); | |||
$this->server->addPlugin(new ImageExportPlugin()); |
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.
Must be added to the serverfactory as well for v1 routes
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
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.
thx
2091112
to
2d23609
Compare
please review @DeepDiver1975 @ChristophWurst @PVince81 |
👍 nice, works! |
use Sabre\VObject\Parameter; | ||
use Sabre\VObject\Reader; | ||
|
||
class ImageExportPlugin extends ServerPlugin { |
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 plugin deserves some unit tests as well 🙈
@ChristophWurst @Gomez did you test this with the mail app? does it work? THX |
Yeah works in Mail! Nice @georgehrke |
6aae6e9
to
72e0732
Compare
// | ||
// TODO: these three below are not working - needs debugging | ||
// | ||
// 'vcard 3 with PHOTO URL' => [['Content-Type' => 'image/jpeg', 'body' => '12345'], "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nPHOTO;TYPE=JPEG:http://example.org/photo.jpg\r\nEND:VCARD\r\n"], |
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.
@georgehrke mind debugging these 3 cases and adjust the code accordingly?
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.
Sure, I can take a look tomorrow
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.
Thx
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.
How is http://example.org/photo.jpg supposed to return '12345' in the first place?
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.
anyway, 'vcard 3 with PHOTO URL' seems to be a bug in Sabre/Vobject because getValueType()
returns BINARY
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.
'vcard 4 with PHOTO URL' is fixed now
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.
How is http://example.org/photo.jpg supposed to return '12345' in the first place?
it's not 🙈
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.
please file issues upstream - thx
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.
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 - fruux/sabre-vobject#325
THX
72e0732
to
836def3
Compare
👍 |
Oooh this is awesome! :) Great work! Will it be backported as well? |
@georgehrke please prepare backport pr - we want to make oc9 users happy as well 🙈 |
sure |
stable9: #25219 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
fixes #23345