// GetAvatarURL gets the user's avatar URL. See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-profile-userid-avatar-url
185
func (cli *Client) GetAvatarURL() (url string, err error) {
	urlPath := cli.BuildURL("profile", cli.UserID, "avatar_url")
	s := struct {
		AvatarURL string `json:"avatar_url"`
	}{}

	_, err = cli.MakeRequest("GET", urlPath, nil, &s)
	if err != nil {
		return "", err
	}

	return s.AvatarURL, nil
}
254084
func (m *MarketplacePlanAccount) GetURL() string {
	if m == nil || m.URL == nil {
		return ""
	}
	return *m.URL
}
114763
func (r *RepositoryComment) GetHTMLURL() string {
	if r == nil || r.HTMLURL == nil {
		return ""
	}
	return *r.HTMLURL
}
437532
func (l *License) GetURL() string {
	if l == nil || l.URL == nil {
		return ""
	}
	return *l.URL
}
1085902
func (g *GistComment) GetURL() string {
	if g == nil || g.URL == nil {
		return ""
	}
	return *g.URL
}
347128
func (s *SourceImportAuthor) GetURL() string {
	if s == nil || s.URL == nil {
		return ""
	}
	return *s.URL
}
774916
func (s *Session) UserAvatar(userID string) (img image.Image, err error) {
	u, err := s.User(userID)
	if err != nil {
		return
	}
	img, err = s.UserAvatarDecode(u)
	return
}
722742
func (c *Contributor) GetHTMLURL() string {
	if c == nil || c.HTMLURL == nil {
		return ""
	}
	return *c.HTMLURL
}
609709
func (r *Repository) GetMirrorURL() string {
	if r == nil || r.MirrorURL == nil {
		return ""
	}
	return *r.MirrorURL
}
846591
func (api UsersAPI) CreateAvatarFromLink(w http.ResponseWriter, r *http.Request) {
	username := mux.Vars(r)["username"]

	avatar := user.Avatar{}

	if err := json.NewDecoder(r.Body).Decode(&avatar); err != nil {
		http.Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
		return
	}

	userMgr := user.NewManager(r)
	u, err := userMgr.GetByName(username)
	if handleServerError(w, "getting user by name", err) {
		return
	}

	if !validateNewAvatar(w, avatar.Label, u) {
		return
	}

	userMgr.SaveAvatar(username, avatar)

	w.WriteHeader(http.StatusCreated)
	json.NewEncoder(w).Encode(&avatar)
}
82749
func (r *RepoStatus) GetURL() string {
	if r == nil || r.URL == nil {
		return ""
	}
	return *r.URL
}
10594
func (u *UserLDAPMapping) GetURL() string {
	if u == nil || u.URL == nil {
		return ""
	}
	return *u.URL
}
562924
func (api UsersAPI) GetAvatars(w http.ResponseWriter, r *http.Request) {
	username := mux.Vars(r)["username"]

	userMgr := user.NewManager(r)
	u, err := userMgr.GetByName(username)
	if handleServerError(w, "getting user from database", err) {
		return
	}

	w.Header().Set("Content-Type", "application/json")
	w.WriteHeader(http.StatusOK)
	json.NewEncoder(w).Encode(&u.Avatars)
}
1305011
func (m *Manager) RemoveAvatar(username, label string) error {
	return m.getUserCollection().Update(
		bson.M{"username": username},
		bson.M{"$pull": bson.M{"avatars": bson.M{"label": label}}})
}
836046
func GetAvatar(client ClientInterface, name string) (string, error) {
	response, err := client.Get(blogPath("/blog/%s/avatar", name))
	if err != nil {
		return "", err
	}
	if location := response.Headers.Get("Location"); len(location) > 0 {
		return location, nil
	}
	if err = response.PopulateFromBody(); err != nil {
		return "", err
	}
	if l, ok := response.Result["location"]; ok {
		if location, ok := l.(string); ok {
			return location, nil
		}
	}
	return "", errors.New("Unable to detect avatar location")
}
1061221
func (u *UserLDAPMapping) GetStarredURL() string {
	if u == nil || u.StarredURL == nil {
		return ""
	}
	return *u.StarredURL
}
990366
func (b *Blob) GetURL() string {
	if b == nil || b.URL == nil {
		return ""
	}
	return *b.URL
}