correct paths used for external service

This commit is contained in:
Sam 2015-09-11 13:18:07 +10:00
parent f6380c66ef
commit 90d49d1497
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ function defaultAvatar(username, letterAvatarColor) {
if (Discourse.SiteSettings.external_letter_avatars_enabled) {
const url = Discourse.SiteSettings.external_letter_avatars_url;
return `${url}/letter/${username[0]}?color=${letterAvatarColor}&size={size}`;
return `${url}/letter/${username[0]}/${letterAvatarColor}/{size}.png`;
} else {
return Discourse.getURLWithCDN(`/letter_avatar/${username.toLowerCase()}/{size}/${version}.png`);
}

View File

@ -454,7 +454,7 @@ class User < ActiveRecord::Base
[((result << 5) - result) + char.ord].pack('L').unpack('l').first
end
avatar_template = split_avatars[hash.abs % split_avatars.size]
split_avatars[hash.abs % split_avatars.size]
end
else
letter_avatar_template(username)
@ -471,7 +471,7 @@ class User < ActiveRecord::Base
def self.letter_avatar_template(username)
if SiteSetting.external_letter_avatars_enabled
color = letter_avatar_color(username)
"#{SiteSetting.external_letter_avatars_url}/letter/#{username[0]}?color=#{color}&size={size}"
"#{SiteSetting.external_letter_avatars_url}/letter/#{username[0]}/#{color}/{size}.png"
else
"#{Discourse.base_uri}/letter_avatar/#{username.downcase}/{size}/#{LetterAvatar.version}.png"
end