AvatarURL returns the full URL to the user or organization avatar. If the user enables Gravatar-like service, then an external URL will be returned. TODO(unknwon): This is also used in templates, which should be fixed by having a dedicated type `template.User` and move this to the "userutil" packag
()
| 1401 | // having a dedicated type `template.User` and move this to the "userutil" |
| 1402 | // package. |
| 1403 | func (u *User) AvatarURL() string { |
| 1404 | link := u.AvatarURLPath() |
| 1405 | if link[0] == '/' && link[1] != '/' { |
| 1406 | return conf.Server.ExternalURL + strings.TrimPrefix(link, conf.Server.Subpath)[1:] |
| 1407 | } |
| 1408 | return link |
| 1409 | } |
| 1410 | |
| 1411 | // IsFollowing returns true if the user is following the given user. |
| 1412 | // |
no test coverage detected