diff options
author | =Corey Hulen <corey@hulen.com> | 2016-01-05 14:48:05 -0600 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2016-01-05 14:48:05 -0600 |
commit | f0e620a4851a61b8164c09bc6f95ee1df5859838 (patch) | |
tree | c70143699e10d18a828935fc53e978e60123cd56 /api/channel.go | |
parent | ee79095fa4d84be3391c16df9a226069598fc0c2 (diff) | |
download | chat-f0e620a4851a61b8164c09bc6f95ee1df5859838.tar.gz chat-f0e620a4851a61b8164c09bc6f95ee1df5859838.tar.bz2 chat-f0e620a4851a61b8164c09bc6f95ee1df5859838.zip |
PLT-1485 Adding last view channel sticky
Diffstat (limited to 'api/channel.go')
-rw-r--r-- | api/channel.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/api/channel.go b/api/channel.go index f17594c0a..b85de3071 100644 --- a/api/channel.go +++ b/api/channel.go @@ -679,6 +679,15 @@ func updateLastViewedAt(c *Context, w http.ResponseWriter, r *http.Request) { Srv.Store.Channel().UpdateLastViewedAt(id, c.Session.UserId) + preference := model.Preference{ + UserId: c.Session.UserId, + Category: model.PREFERENCE_CATEGORY_LAST, + Name: model.PREFERENCE_NAME_LAST_CHANNEL, + Value: id, + } + + Srv.Store.Preference().Save(&model.Preferences{preference}) + message := model.NewMessage(c.Session.TeamId, id, c.Session.UserId, model.ACTION_CHANNEL_VIEWED) message.Add("channel_id", id) |