From f0084229a5ca6a0c51addb888237f6eb42becbfb Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 25 Feb 2016 04:24:03 -0300 Subject: Member show on Activate and Hide on deactivate from channel member list and at_mention --- store/sql_channel_store.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'store/sql_channel_store.go') 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 +} -- cgit v1.2.3-1-g7c22