|
@@ -262,15 +262,21 @@ func (s *Session) User(userID string) (st *User, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// UserAvatar returns an image.Image of a users Avatar.
|
|
|
+// UserAvatar is deprecated. Please use UserAvatarDecode
|
|
|
// userID : A user ID or "@me" which is a shortcut of current user ID
|
|
|
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
|
|
|
+}
|
|
|
|
|
|
- body, err := s.RequestWithBucketID("GET", EndpointUserAvatar(userID, u.Avatar), nil, EndpointUserAvatar("", ""))
|
|
|
+// UserAvatarDecode returns an image.Image of a user's Avatar
|
|
|
+// user : The user which avatar should be retrieved
|
|
|
+func (s *Session) UserAvatarDecode(u *User) (img image.Image, err error) {
|
|
|
+ body, err := s.RequestWithBucketID("GET", EndpointUserAvatar(u.ID, u.Avatar), nil, EndpointUserAvatar("", ""))
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|