summaryrefslogtreecommitdiffstats
path: root/store/sql_channel_store.go
diff options
context:
space:
mode:
authorElias Nahum <nahumhbl@gmail.com>2016-02-25 04:24:03 -0300
committerElias Nahum <nahumhbl@gmail.com>2016-02-25 04:24:03 -0300
commitf0084229a5ca6a0c51addb888237f6eb42becbfb (patch)
tree7f6f2e82b5e87d3d3c9fc6249630891c22799117 /store/sql_channel_store.go
parent6f319fc64c9a947d8f076262aaab51354cb39ecd (diff)
downloadchat-f0084229a5ca6a0c51addb888237f6eb42becbfb.tar.gz
chat-f0084229a5ca6a0c51addb888237f6eb42becbfb.tar.bz2
chat-f0084229a5ca6a0c51addb888237f6eb42becbfb.zip
Member show on Activate and Hide on deactivate from channel member list and at_mention
Diffstat (limited to 'store/sql_channel_store.go')
-rw-r--r--store/sql_channel_store.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go
index 87ee2bb11..35322e061 100644
--- a/store/sql_channel_store.go
+++ b/store/sql_channel_store.go
@@ -924,3 +924,25 @@ func (s SqlChannelStore) AnalyticsTypeCount(teamId string, channelType string) S
return storeChannel
}
+
+func (s SqlChannelStore) ExtraUpdateByUser(userId string, time int64) StoreChannel {
+ storeChannel := make(StoreChannel)
+
+ go func() {
+ result := StoreResult{}
+
+ _, err := s.GetMaster().Exec(
+ `UPDATE Channels SET ExtraUpdateAt = :Time
+ WHERE Id IN (SELECT ChannelId FROM ChannelMembers WHERE UserId = :UserId);`,
+ map[string]interface{}{"UserId": userId, "Time": time})
+
+ if err != nil {
+ result.Err = model.NewLocAppError("SqlChannelStore.extraUpdated", "store.sql_channel.extra_updated.app_error", nil, "user_id="+userId+", "+err.Error())
+ }
+
+ storeChannel <- result
+ close(storeChannel)
+ }()
+
+ return storeChannel
+}