Skip to content

Add avatar dav endpoint - #21311

Closed
rullzer wants to merge 2 commits into
masterfrom
dav_avatar
Closed

rullzer wants to merge 2 commits into
masterfrom
dav_avatar

Conversation

@rullzer

@rullzer rullzer commented Dec 21, 2015

Copy link
Copy Markdown
Contributor

This add an avatar collection to the new dav endpoint. Right now it is still authenticated but once we figure it out properly we can have anonymous actions here (for getting!) avatars. But for now it will allow authenticated clients to retrieve avatars for local users.

Pretty straight forward actually.

CC: @DeepDiver1975 @PVince81 @nickvergessen

@rullzer rullzer added this to the 9.0-current milestone Dec 21, 2015
@mention-bot

Copy link
Copy Markdown

By analyzing the blame information on this pull request, we identified @DeepDiver1975, @PVince81 and @schiesbn to be potential reviewers

@MorrisJobke

Copy link
Copy Markdown
Contributor

Tested and works nicely :) 👍

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@DeepDiver1975

Copy link
Copy Markdown
Contributor

a request to get the avatar should really look like

GET http://server/remote.php/dav/avatars/$user/128.png

@rullzer

rullzer commented Dec 22, 2015

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 no. Since avatars can be jpg or png. There is no way to know which beforehand (or we need to convert them on the fly). The old endpoint also does not have this and I assume it is for the same reason.

@PVince81

Copy link
Copy Markdown
Contributor

If users were Webdav resources, they could all have a "avatar" property that points to the URL of the avatar with the correct extension.

@rullzer

rullzer commented Dec 22, 2015

Copy link
Copy Markdown
Contributor Author

I don't care how we'll handle it. I just want to make sure that there is only 1 request to the server to obtain avatars :P And not 2.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

There is no way to know which beforehand (or we need to convert them on the fly).

we better do - see my code - thx

@DeepDiver1975

Copy link
Copy Markdown
Contributor

If users were Webdav resources, they could all have a "avatar" property that points to the URL of the avatar with the correct extension.

a property like that can be added easily - caldav and carddav define a home propery - see http://icalendar.org/CalDAV-Access-RFC-4791/6-2-1-caldav-calendar-home-set-property.html

@rullzer

rullzer commented Dec 22, 2015

Copy link
Copy Markdown
Contributor Author

Yes I was planning to do that in a followup PR. But still this adds an extra server call for all avatars

@rullzer

rullzer commented Dec 22, 2015

Copy link
Copy Markdown
Contributor Author

Ok so as discussed on IRC:

Probabaly it makes sense to add the availibity of an avatar to the shareeAPI. That way clients will not retrieve the avatar if it is not there.

If the avatar is available we could include an URL template. Something like

avatar = {
  'available' : true,
  'baseurl' : 'https://server/remote.php/dav/avatars/userid/
  'ext' : 'png'
}

That way clients can themself efficiently generate the URL.

So... TODO:

  • Update Sharee API
  • Update URL generator
  • Update dav avatar endpoint with ext

@rullzer

rullzer commented Dec 22, 2015

Copy link
Copy Markdown
Contributor Author

Ok now with file extension.

I'll fix the other stuff in other PR's since it different parts of the code and code wise unrelated.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No license 🙅

@nickvergessen

Copy link
Copy Markdown
Contributor

Probabaly it makes sense to add the availibity of an avatar to the shareeAPI. That way clients will not retrieve the avatar if it is not there.

Does this mean you will then in the api call all the remote web davs to check the availability? makes no sense to me, or did I not understand you correctly?

@rullzer

rullzer commented Jan 5, 2016

Copy link
Copy Markdown
Contributor Author

@nickvergessen no that is not what I ment.

The whole story is that I talked to @DeepDiver1975 and when we have carddav sharing for federated shares (so your ownCloud instance 'knows' the users on my instance). That those vcards also contain the avatar. Thus if we know the remote we could easily generate the avatar locally eventually.

It is something we need to think more about to streamline (Where to store those avatars... etc). But the idea seems nicer.

@rullzer rullzer modified the milestones: backlog, 9.0-current Jan 12, 2016
@rullzer

rullzer commented Apr 2, 2016

Copy link
Copy Markdown
Contributor Author

Let me close this as it will need to be reworked largely anyway.

@rullzer rullzer closed this Apr 2, 2016
@rullzer
rullzer deleted the dav_avatar branch April 2, 2016 07:33
@MorrisJobke MorrisJobke removed this from the backlog milestone Apr 3, 2016
@lock

lock Bot commented Aug 6, 2019

Copy link
Copy Markdown

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.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants