MCPcopy Create free account
hub / github.com/gogs/gogs / AvatarURL

Method AvatarURL

internal/database/users.go:1403–1409  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

1401// having a dedicated type `template.User` and move this to the "userutil"
1402// package.
1403func (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//

Callers 3

APIFormatMethod · 0.95
SearchFunction · 0.80
ToOrganizationFunction · 0.80

Implementers 1

mailerUserinternal/database/issue_mail.go

Calls 1

AvatarURLPathMethod · 0.95

Tested by

no test coverage detected