mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-02-17 12:11:16 -05:00
download largest gravatar image
This commit is contained in:
parent
80ee30003a
commit
fe4f8b1519
1 changed files with 2 additions and 1 deletions
|
@ -17,7 +17,8 @@ class UserAvatar < ActiveRecord::Base
|
|||
|
||||
self.last_gravatar_download_attempt = Time.new
|
||||
|
||||
gravatar_url = "http://www.gravatar.com/avatar/#{email_hash}.png?s=500&d=404"
|
||||
max = Discourse.avatar_sizes.max
|
||||
gravatar_url = "http://www.gravatar.com/avatar/#{email_hash}.png?s=#{max}&d=404"
|
||||
tempfile = FileHelper.download(gravatar_url, SiteSetting.max_image_size_kb.kilobytes, "gravatar")
|
||||
upload = Upload.create_for(user.id, tempfile, 'gravatar.png', tempfile.size, { origin: gravatar_url })
|
||||
|
||||
|
|
Loading…
Reference in a new issue