From 2b4888d062d65546325470d2d9181f4a66a2fb00 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Mon, 22 Jun 2015 14:23:59 -0400 Subject: fixes mm-1316 improves channel notifications UI and updates channellist etag --- model/channel_list.go | 6 ++++++ model/channel_member.go | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'model') 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 } -- cgit v1.2.3-1-g7c22 From d090f5698addecf5e6a0380601ee5550563071c5 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Mon, 22 Jun 2015 14:38:35 -0400 Subject: update etag version --- model/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'model') 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 -- cgit v1.2.3-1-g7c22