summaryrefslogtreecommitdiffstats
path: root/model/user.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-07-18 11:10:03 -0400
committerGitHub <noreply@github.com>2016-07-18 11:10:03 -0400
commitc0ab2636d699c8544ce03a58f61b95cfd66ff7ce (patch)
treec7d07934e0ff1a75aafb097a184ae150888199c0 /model/user.go
parent180adc79af3d14de6ce62f6e687a6735db3fe82f (diff)
downloadchat-c0ab2636d699c8544ce03a58f61b95cfd66ff7ce.tar.gz
chat-c0ab2636d699c8544ce03a58f61b95cfd66ff7ce.tar.bz2
chat-c0ab2636d699c8544ce03a58f61b95cfd66ff7ce.zip
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
Diffstat (limited to 'model/user.go')
-rw-r--r--model/user.go16
1 files changed, 0 insertions, 16 deletions
diff --git a/model/user.go b/model/user.go
index bf6866b27..2a7427748 100644
--- a/model/user.go
+++ b/model/user.go
@@ -16,11 +16,6 @@ import (
const (
ROLE_SYSTEM_ADMIN = "system_admin"
- USER_AWAY_TIMEOUT = 5 * 60 * 1000 // 5 minutes
- USER_OFFLINE_TIMEOUT = 1 * 60 * 1000 // 1 minute
- USER_OFFLINE = "offline"
- USER_AWAY = "away"
- USER_ONLINE = "online"
USER_NOTIFY_ALL = "all"
USER_NOTIFY_MENTION = "mention"
USER_NOTIFY_NONE = "none"
@@ -44,8 +39,6 @@ type User struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Roles string `json:"roles"`
- LastActivityAt int64 `json:"last_activity_at,omitempty"`
- LastPingAt int64 `json:"last_ping_at,omitempty"`
AllowMarketing bool `json:"allow_marketing,omitempty"`
Props StringMap `json:"props,omitempty"`
NotifyProps StringMap `json:"notify_props,omitempty"`
@@ -222,14 +215,6 @@ func (u *User) Etag(showFullName, showEmail bool) string {
return Etag(u.Id, u.UpdateAt, showFullName, showEmail)
}
-func (u *User) IsOffline() bool {
- return (GetMillis()-u.LastPingAt) > USER_OFFLINE_TIMEOUT && (GetMillis()-u.LastActivityAt) > USER_OFFLINE_TIMEOUT
-}
-
-func (u *User) IsAway() bool {
- return (GetMillis() - u.LastActivityAt) > USER_AWAY_TIMEOUT
-}
-
// Remove any private data from the user object
func (u *User) Sanitize(options map[string]bool) {
u.Password = ""
@@ -258,7 +243,6 @@ func (u *User) ClearNonProfileFields() {
u.MfaActive = false
u.MfaSecret = ""
u.EmailVerified = false
- u.LastPingAt = 0
u.AllowMarketing = false
u.Props = StringMap{}
u.NotifyProps = StringMap{}