summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-08-02 09:41:12 -0800
committer=Corey Hulen <corey@hulen.com>2015-08-02 09:41:12 -0800
commit247708d924770737a3c03f956b19d8096da2bdea (patch)
tree3d6bd381545e660808f74a1379048e57cc0c6717 /model
parente76fc37b6df7d53ea86a5b42009d5d1161741270 (diff)
parent718d670d699e295fcad903d507bc989c51a1ef50 (diff)
downloadchat-247708d924770737a3c03f956b19d8096da2bdea.tar.gz
chat-247708d924770737a3c03f956b19d8096da2bdea.tar.bz2
chat-247708d924770737a3c03f956b19d8096da2bdea.zip
Merge branch 'master' into mm-1619
Diffstat (limited to 'model')
-rw-r--r--model/channel.go12
-rw-r--r--model/client.go4
-rw-r--r--model/user.go1
3 files changed, 14 insertions, 3 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()
+}
diff --git a/model/client.go b/model/client.go
index 17bb898ca..a5016fa2c 100644
--- a/model/client.go
+++ b/model/client.go
@@ -457,8 +457,8 @@ func (c *Client) UpdateLastViewedAt(channelId string) (*Result, *AppError) {
}
}
-func (c *Client) GetChannelExtraInfo(id string) (*Result, *AppError) {
- if r, err := c.DoGet("/channels/"+id+"/extra_info", "", ""); err != nil {
+func (c *Client) GetChannelExtraInfo(id string, etag string) (*Result, *AppError) {
+ if r, err := c.DoGet("/channels/"+id+"/extra_info", "", etag); err != nil {
return nil, err
} else {
return &Result{r.Header.Get(HEADER_REQUEST_ID),
diff --git a/model/user.go b/model/user.go
index c71d75405..ed5161538 100644
--- a/model/user.go
+++ b/model/user.go
@@ -51,6 +51,7 @@ type User struct {
NotifyProps StringMap `json:"notify_props"`
LastPasswordUpdate int64 `json:"last_password_update"`
LastPictureUpdate int64 `json:"last_picture_update"`
+ FailedAttempts int `json:"failed_attempts"`
}
type GitLabUser struct {