From 139f6611d6162158ea88c679aee710f7a6c76c49 Mon Sep 17 00:00:00 2001 From: nickago Date: Thu, 16 Jul 2015 08:55:37 -0700 Subject: Added last updated for pictures --- store/sql_user_store.go | 7 +++++-- store/store.go | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'store') 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 diff --git a/store/store.go b/store/store.go index 0ed045788..9faa6a9d7 100644 --- a/store/store.go +++ b/store/store.go @@ -77,7 +77,7 @@ type PostStore interface { type UserStore interface { Save(user *model.User) StoreChannel Update(user *model.User, allowRoleUpdate bool) StoreChannel - UpdateUpdateAt(userId string) StoreChannel + UpdateLastPictureUpdate(userId string) StoreChannel UpdateLastPingAt(userId string, time int64) StoreChannel UpdateLastActivityAt(userId string, time int64) StoreChannel UpdateUserAndSessionActivity(userId string, sessionId string, time int64) StoreChannel -- cgit v1.2.3-1-g7c22