summaryrefslogtreecommitdiffstats
path: root/model/channel_member.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-06-22 14:23:59 -0400
committerJoramWilander <jwawilander@gmail.com>2015-06-29 07:45:12 -0400
commit2b4888d062d65546325470d2d9181f4a66a2fb00 (patch)
tree23cb6c57a055370256cb7e71781e75412b681b3c /model/channel_member.go
parentafb62bb40a012a7e00707f384020e1431abca1ed (diff)
downloadchat-2b4888d062d65546325470d2d9181f4a66a2fb00.tar.gz
chat-2b4888d062d65546325470d2d9181f4a66a2fb00.tar.bz2
chat-2b4888d062d65546325470d2d9181f4a66a2fb00.zip
fixes mm-1316 improves channel notifications UI and updates channellist etag
Diffstat (limited to 'model/channel_member.go')
-rw-r--r--model/channel_member.go5
1 files changed, 5 insertions, 0 deletions
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
}