summaryrefslogtreecommitdiffstats
path: root/app/user.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-11-16 15:04:27 -0600
committerJonathan <jonfritz@gmail.com>2017-11-16 16:04:27 -0500
commiteb1a00ef5f93b19c2d49b26de057ee2c51c09e45 (patch)
treee63afa695283e15c5cd9ee2a437d74024dcc5c20 /app/user.go
parentef69d93abfb192bc7a2416f3cf2622d99fd27dd5 (diff)
downloadchat-eb1a00ef5f93b19c2d49b26de057ee2c51c09e45.tar.gz
chat-eb1a00ef5f93b19c2d49b26de057ee2c51c09e45.tar.bz2
chat-eb1a00ef5f93b19c2d49b26de057ee2c51c09e45.zip
Reorganize file util functionality (#7848)
* reorganize file util functionality * fix api test compilation * fix rebase issue
Diffstat (limited to 'app/user.go')
-rw-r--r--app/user.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/user.go b/app/user.go
index 48237f300..358a87711 100644
--- a/app/user.go
+++ b/app/user.go
@@ -751,7 +751,7 @@ func (a *App) GetProfileImage(user *model.User) ([]byte, bool, *model.AppError)
} else {
path := "users/" + user.Id + "/profile.png"
- if data, err := utils.ReadFile(path); err != nil {
+ if data, err := a.ReadFile(path); err != nil {
readFailed = true
if img, err = CreateProfileImage(user.Username, user.Id, a.Config().FileSettings.InitialFont); err != nil {
@@ -759,7 +759,7 @@ func (a *App) GetProfileImage(user *model.User) ([]byte, bool, *model.AppError)
}
if user.LastPictureUpdate == 0 {
- if err := utils.WriteFile(img, path); err != nil {
+ if err := a.WriteFile(img, path); err != nil {
return nil, false, err
}
}
@@ -812,7 +812,7 @@ func (a *App) SetProfileImage(userId string, imageData *multipart.FileHeader) *m
path := "users/" + userId + "/profile.png"
- if err := utils.WriteFile(buf.Bytes(), path); err != nil {
+ if err := a.WriteFile(buf.Bytes(), path); err != nil {
return model.NewAppError("SetProfileImage", "api.user.upload_profile_user.upload_profile.app_error", nil, "", http.StatusInternalServerError)
}