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

Use avatars #1202

Closed
tobiasKaminsky opened this issue Jul 17, 2017 · 5 comments
Closed

Use avatars #1202

tobiasKaminsky opened this issue Jul 17, 2017 · 5 comments

Comments

@tobiasKaminsky
Copy link
Member

This is possible via this url, back to nc10: https://cloud.cloud.com/avatar/$username/$pixel
It will return either an image or {"data":{"displayname":"tobi"}} if the user set no image.

I opened an issue about this: nextcloud/server#5750
--> always generate a avatar image & provide proper versioning.

@AndyScherzinger
Copy link
Member

👍 a support this case!

@tobiasKaminsky
Copy link
Member Author

This now done in nextcloud/server#6876 for >=NC13.
So we can add this with a version check and as "soon" as NC13 is the oldest supported release we can remove the placeholder generation in our code.

@xXSTrikeXx
Copy link
Contributor

@tobiasKaminsky Afaik you implemented shortly a static image when no fetch is possible? So this can be closed?

@AndyScherzinger
Copy link
Member

Don't think so.
This issue is about even getting the placeholder from the server as a fallback.

@tobiasKaminsky
Copy link
Member Author

We already get the image from server for newer server versions.
If NC13 is our oldest supported server, we can drop our generation of avatars, therefore the custom annotation is used:

@NextcloudServer(max = 12)
public static TextDrawable createAvatar(String accountName, float radiusInDp) throws
UnsupportedEncodingException, NoSuchAlgorithmException {
String username = AccountUtils.getAccountUsername(accountName);
return createNamedAvatar(username, radiusInDp);
}

As this is in code, we can indeed close this issue.

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

No branches or pull requests

3 participants