summaryrefslogtreecommitdiffstats
path: root/model/channel.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-07-29 11:30:56 -0400
committerChristopher Speller <crspeller@gmail.com>2015-07-29 14:35:25 -0400
commit3f97e06bf80c789ce8e2d572afdac65a73d417c8 (patch)
treece40eba90031c423c209670c28f902966e0d4f9b /model/channel.go
parent0f54233f668901fde880f18354f406b981fc4d6d (diff)
downloadchat-3f97e06bf80c789ce8e2d572afdac65a73d417c8.tar.gz
chat-3f97e06bf80c789ce8e2d572afdac65a73d417c8.tar.bz2
chat-3f97e06bf80c789ce8e2d572afdac65a73d417c8.zip
Adding etag to channel extra_info api call.
Diffstat (limited to 'model/channel.go')
-rw-r--r--model/channel.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/model/channel.go b/model/channel.go
index ab36d46a2..94b8fdb43 100644
--- a/model/channel.go
+++ b/model/channel.go
@@ -27,6 +27,7 @@ type Channel struct {
Description string `json:"description"`
LastPostAt int64 `json:"last_post_at"`
TotalMsgCount int64 `json:"total_msg_count"`
+ ExtraUpdateAt int64 `json:"extra_update_at"`
}
func (o *Channel) ToJson() string {
@@ -50,7 +51,11 @@ func ChannelFromJson(data io.Reader) *Channel {
}
func (o *Channel) Etag() string {
- return Etag(o.Id, o.LastPostAt)
+ return Etag(o.Id, o.UpdateAt)
+}
+
+func (o *Channel) ExtraEtag() string {
+ return Etag(o.Id, o.ExtraUpdateAt)
}
func (o *Channel) IsValid() *AppError {
@@ -97,8 +102,13 @@ func (o *Channel) PreSave() {
o.CreateAt = GetMillis()
o.UpdateAt = o.CreateAt
+ o.ExtraUpdateAt = o.CreateAt
}
func (o *Channel) PreUpdate() {
o.UpdateAt = GetMillis()
}
+
+func (o *Channel) ExtraUpdated() {
+ o.ExtraUpdateAt = GetMillis()
+}