//Info returns a *Info struct func (user *User) Info() *Info { website, _ := url.Parse(user.Profile.Website) return &Info{ Id: user.Counter, Owner: user, NumericOwner: user.Counter, Followers: user.Followers(), NumericFollowers: user.NumericFollowers(), Name: user.Name, Website: website, Image: utils.Gravatar(user.Email), Closed: user.Profile.Closed} }
// PersonalInfo returns a *PersonalInfo struct func (user *User) PersonalInfo() *PersonalInfo { return &PersonalInfo{ Username: user.Username, IsOnline: user.Viewonline && user.Last.Add(time.Duration(5)*time.Minute).After(time.Now()), Nation: user.Lang, Timezone: user.Timezone, Name: user.Name, Surname: user.Surname, Gender: user.Gender, Birthday: user.BirthDate, Gravatar: utils.Gravatar(user.Email), Interests: user.Interests(), Quotes: strings.Split(user.Profile.Quotes, "\n"), Biography: user.Profile.Biography} }
//Info returns a *info struct func (user *User) Info() *Info { website, _ := url.Parse(user.Profile.Website) gravaURL := utils.Gravatar(user.Email) boardURL, _ := url.Parse(Configuration.NERDZHost) boardURL.Path = user.Username + "." return &Info{ ID: user.ID(), Owner: nil, Name: user.Name, Username: user.Username, Website: website, Image: gravaURL, Closed: user.Profile.Closed, BoardString: boardURL.String(), Type: UserBoardID} }