summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorAsaad Mahmood <Unknowngi@live.com>2015-06-29 20:38:02 +0500
committerAsaad Mahmood <Unknowngi@live.com>2015-06-29 20:38:02 +0500
commitfce4ad42cbbcd890c9bc8d5fc4963eec7b4867dc (patch)
tree4ea6caf1e890703b4bb4e727ebce0099dfc88327 /model
parent86f774e1b07cda8b451bf5fa23b6de2a1d78dfea (diff)
parent0792eb18d535410b456f3cc569e243efb85a47b6 (diff)
downloadchat-fce4ad42cbbcd890c9bc8d5fc4963eec7b4867dc.tar.gz
chat-fce4ad42cbbcd890c9bc8d5fc4963eec7b4867dc.tar.bz2
chat-fce4ad42cbbcd890c9bc8d5fc4963eec7b4867dc.zip
Merge branch 'master' of https://github.com/mattermost/platform
Diffstat (limited to 'model')
-rw-r--r--model/channel_list.go6
-rw-r--r--model/channel_member.go5
-rw-r--r--model/utils.go2
3 files changed, 12 insertions, 1 deletions
diff --git a/model/channel_list.go b/model/channel_list.go
index 088dbea2a..09f14a986 100644
--- a/model/channel_list.go
+++ b/model/channel_list.go
@@ -53,6 +53,12 @@ func (o *ChannelList) Etag() string {
t = member.LastViewedAt
id = v.Id
}
+
+ if member.LastUpdateAt > t {
+ t = member.LastUpdateAt
+ id = v.Id
+ }
+
}
}
diff --git a/model/channel_member.go b/model/channel_member.go
index 720ac4c42..50f51304b 100644
--- a/model/channel_member.go
+++ b/model/channel_member.go
@@ -25,6 +25,7 @@ type ChannelMember struct {
MsgCount int64 `json:"msg_count"`
MentionCount int64 `json:"mention_count"`
NotifyLevel string `json:"notify_level"`
+ LastUpdateAt int64 `json:"last_update_at"`
}
func (o *ChannelMember) ToJson() string {
@@ -70,6 +71,10 @@ func (o *ChannelMember) IsValid() *AppError {
return nil
}
+func (o *ChannelMember) PreSave() {
+ o.LastUpdateAt = GetMillis()
+}
+
func IsChannelNotifyLevelValid(notifyLevel string) bool {
return notifyLevel == CHANNEL_NOTIFY_ALL || notifyLevel == CHANNEL_NOTIFY_MENTION || notifyLevel == CHANNEL_NOTIFY_NONE || notifyLevel == CHANNEL_NOTIFY_QUIET
}
diff --git a/model/utils.go b/model/utils.go
index 262bda319..cc51dfe47 100644
--- a/model/utils.go
+++ b/model/utils.go
@@ -17,7 +17,7 @@ import (
)
const (
- ETAG_ROOT_VERSION = "10"
+ ETAG_ROOT_VERSION = "11"
)
type StringMap map[string]string