From c0ab2636d699c8544ce03a58f61b95cfd66ff7ce Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Mon, 18 Jul 2016 11:10:03 -0400 Subject: PLT-2241 Refactored statuses into a more real-time system (#3573) * Refactored statuses into a more real-time system * Updated package.json with correct commit and fixed minor bug * Minor updates to statuses based on feedback * When setting status online, update only LastActivityAt if status already exists --- store/store.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'store/store.go') diff --git a/store/store.go b/store/store.go index 4b5c0e8cd..c495ff927 100644 --- a/store/store.go +++ b/store/store.go @@ -43,6 +43,7 @@ type Store interface { License() LicenseStore PasswordRecovery() PasswordRecoveryStore Emoji() EmojiStore + Status() StatusStore MarkSystemRanUnitTests() Close() DropAllTables() @@ -126,9 +127,6 @@ type UserStore interface { Update(user *model.User, allowRoleUpdate bool) StoreChannel UpdateLastPictureUpdate(userId string) 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 UpdatePassword(userId, newPassword string) StoreChannel UpdateAuthData(userId string, service string, authData *string, email string) StoreChannel UpdateMfaSecret(userId, secret string) StoreChannel @@ -150,7 +148,6 @@ type UserStore interface { GetEtagForDirectProfiles(userId string) StoreChannel UpdateFailedPasswordAttempts(userId string, attempts int) StoreChannel GetTotalUsersCount() StoreChannel - GetTotalActiveUsersCount() StoreChannel GetSystemAdminProfiles() StoreChannel PermanentDelete(userId string) StoreChannel AnalyticsUniqueUserCount(teamId string) StoreChannel @@ -264,3 +261,12 @@ type EmojiStore interface { GetAll() StoreChannel Delete(id string, time int64) StoreChannel } + +type StatusStore interface { + SaveOrUpdate(status *model.Status) StoreChannel + Get(userId string) StoreChannel + GetOnlineAway() StoreChannel + ResetAll() StoreChannel + GetTotalActiveUsersCount() StoreChannel + UpdateLastActivityAt(userId string, lastActivityAt int64) StoreChannel +} -- cgit v1.2.3-1-g7c22