diff options
author | nickago <ngonella@calpoly.edu> | 2015-07-16 08:55:37 -0700 |
---|---|---|
committer | nickago <ngonella@calpoly.edu> | 2015-07-16 08:55:37 -0700 |
commit | 139f6611d6162158ea88c679aee710f7a6c76c49 (patch) | |
tree | 3ac9a0413a86773f4217b540f006d3f4053aa582 /store/sql_user_store.go | |
parent | 463e89c280d50c017d8ca5baef5edf90ff9299a7 (diff) | |
download | chat-139f6611d6162158ea88c679aee710f7a6c76c49.tar.gz chat-139f6611d6162158ea88c679aee710f7a6c76c49.tar.bz2 chat-139f6611d6162158ea88c679aee710f7a6c76c49.zip |
Added last updated for pictures
Diffstat (limited to 'store/sql_user_store.go')
-rw-r--r-- | store/sql_user_store.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/store/sql_user_store.go b/store/sql_user_store.go index 77470946c..dd11dd0ae 100644 --- a/store/sql_user_store.go +++ b/store/sql_user_store.go @@ -120,6 +120,7 @@ func (us SqlUserStore) Update(user *model.User, allowActiveUpdate bool) StoreCha user.AuthData = oldUser.AuthData user.Password = oldUser.Password user.LastPasswordUpdate = oldUser.LastPasswordUpdate + user.LastPictureUpdate = oldUser.LastPictureUpdate user.TeamId = oldUser.TeamId user.LastActivityAt = oldUser.LastActivityAt user.LastPingAt = oldUser.LastPingAt @@ -150,13 +151,15 @@ func (us SqlUserStore) Update(user *model.User, allowActiveUpdate bool) StoreCha return storeChannel } -func (us SqlUserStore) UpdateUpdateAt(userId string) StoreChannel { +func (us SqlUserStore) UpdateLastPictureUpdate(userId string) StoreChannel { storeChannel := make(StoreChannel) go func() { result := StoreResult{} - if _, err := us.GetMaster().Exec("UPDATE Users SET UpdateAt = ? WHERE Id = ?", model.GetMillis(), userId); err != nil { + curTime := model.GetMillis() + + if _, err := us.GetMaster().Exec("UPDATE Users SET LastPictureUpdate = ?, UpdateAt = ? WHERE Id = ?", curTime, curTime, userId); err != nil { result.Err = model.NewAppError("SqlUserStore.UpdateUpdateAt", "We couldn't update the update_at", "user_id="+userId) } else { result.Data = userId |