summaryrefslogtreecommitdiffstats
path: root/store
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-07-13 14:36:27 -0400
committerChristopher Speller <crspeller@gmail.com>2015-07-13 14:36:27 -0400
commite38ea318a1287710313a0c86fecb76dff8a923aa (patch)
tree79a5158a3036563eb45852293f0c5a4af1a196b7 /store
parentd2602f540c953ffea2e622ed4c699ab44eadd087 (diff)
parentaff43f43f8185ae6d5555ca9f99bfcc4bd3eb99e (diff)
downloadchat-e38ea318a1287710313a0c86fecb76dff8a923aa.tar.gz
chat-e38ea318a1287710313a0c86fecb76dff8a923aa.tar.bz2
chat-e38ea318a1287710313a0c86fecb76dff8a923aa.zip
Merge pull request #158 from nickago/MM-975
MM-975 Added timestamps to pictures to stop caching
Diffstat (limited to 'store')
-rw-r--r--store/sql_user_store.go19
-rw-r--r--store/store.go1
2 files changed, 20 insertions, 0 deletions
diff --git a/store/sql_user_store.go b/store/sql_user_store.go
index fc3d125c4..77470946c 100644
--- a/store/sql_user_store.go
+++ b/store/sql_user_store.go
@@ -150,6 +150,25 @@ func (us SqlUserStore) Update(user *model.User, allowActiveUpdate bool) StoreCha
return storeChannel
}
+func (us SqlUserStore) UpdateUpdateAt(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 {
+ result.Err = model.NewAppError("SqlUserStore.UpdateUpdateAt", "We couldn't update the update_at", "user_id="+userId)
+ } else {
+ result.Data = userId
+ }
+
+ storeChannel <- result
+ close(storeChannel)
+ }()
+
+ return storeChannel
+}
+
func (us SqlUserStore) UpdateLastPingAt(userId string, time int64) StoreChannel {
storeChannel := make(StoreChannel)
diff --git a/store/store.go b/store/store.go
index 070ee0562..0ed045788 100644
--- a/store/store.go
+++ b/store/store.go
@@ -77,6 +77,7 @@ type PostStore interface {
type UserStore interface {
Save(user *model.User) StoreChannel
Update(user *model.User, allowRoleUpdate bool) StoreChannel
+ UpdateUpdateAt(userId string) StoreChannel
UpdateLastPingAt(userId string, time int64) StoreChannel
UpdateLastActivityAt(userId string, time int64) StoreChannel
UpdateUserAndSessionActivity(userId string, sessionId string, time int64) StoreChannel