diff options
author | Jesse Hallam <jesse.hallam@gmail.com> | 2018-05-14 09:43:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-14 09:43:06 -0400 |
commit | 7e7c55198719337e7cb39b07c0d5a48c0a6908de (patch) | |
tree | 83ddc7fced3ab2fa4bd54da20155e336db53522e /store/sqlstore/channel_store.go | |
parent | c9196af23efae32f7d836b20d6e41ec4d09a43ce (diff) | |
download | chat-7e7c55198719337e7cb39b07c0d5a48c0a6908de.tar.gz chat-7e7c55198719337e7cb39b07c0d5a48c0a6908de.tar.bz2 chat-7e7c55198719337e7cb39b07c0d5a48c0a6908de.zip |
MM-9739: deprecate the now unused Channels.ExtraUpdateAt (#8762)
Diffstat (limited to 'store/sqlstore/channel_store.go')
-rw-r--r-- | store/sqlstore/channel_store.go | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/store/sqlstore/channel_store.go b/store/sqlstore/channel_store.go index 3bd87961a..eebc3ad69 100644 --- a/store/sqlstore/channel_store.go +++ b/store/sqlstore/channel_store.go @@ -270,25 +270,6 @@ func (s SqlChannelStore) Update(channel *model.Channel) store.StoreChannel { }) } -func (s SqlChannelStore) extraUpdated(channel *model.Channel) store.StoreChannel { - return store.Do(func(result *store.StoreResult) { - channel.ExtraUpdated() - - _, err := s.GetMaster().Exec( - `UPDATE - Channels - SET - ExtraUpdateAt = :Time - WHERE - Id = :Id`, - map[string]interface{}{"Id": channel.Id, "Time": channel.ExtraUpdateAt}) - - if err != nil { - result.Err = model.NewAppError("SqlChannelStore.extraUpdated", "store.sql_channel.extra_updated.app_error", nil, "id="+channel.Id+", "+err.Error(), http.StatusInternalServerError) - } - }) -} - func (s SqlChannelStore) GetChannelUnread(channelId, userId string) store.StoreChannel { return store.Do(func(result *store.StoreResult) { var unreadChannel model.ChannelUnread @@ -750,10 +731,6 @@ func (s SqlChannelStore) SaveMember(member *model.ChannelMember) store.StoreChan if err := transaction.Commit(); err != nil { result.Err = model.NewAppError("SqlChannelStore.SaveMember", "store.sql_channel.save_member.commit_transaction.app_error", nil, err.Error(), http.StatusInternalServerError) } - // If successfull record members have changed in channel - if mu := <-s.extraUpdated(channel); mu.Err != nil { - result.Err = mu.Err - } } } } @@ -1055,21 +1032,9 @@ func (s SqlChannelStore) GetMemberCount(channelId string, allowFromCache bool) s func (s SqlChannelStore) RemoveMember(channelId string, userId string) store.StoreChannel { return store.Do(func(result *store.StoreResult) { - // Grab the channel we are saving this member to - if cr := <-s.Get(channelId, true); cr.Err != nil { - result.Err = cr.Err - } else { - channel := cr.Data.(*model.Channel) - - _, err := s.GetMaster().Exec("DELETE FROM ChannelMembers WHERE ChannelId = :ChannelId AND UserId = :UserId", map[string]interface{}{"ChannelId": channelId, "UserId": userId}) - if err != nil { - result.Err = model.NewAppError("SqlChannelStore.RemoveMember", "store.sql_channel.remove_member.app_error", nil, "channel_id="+channelId+", user_id="+userId+", "+err.Error(), http.StatusInternalServerError) - } else { - // If successfull record members have changed in channel - if mu := <-s.extraUpdated(channel); mu.Err != nil { - result.Err = mu.Err - } - } + _, err := s.GetMaster().Exec("DELETE FROM ChannelMembers WHERE ChannelId = :ChannelId AND UserId = :UserId", map[string]interface{}{"ChannelId": channelId, "UserId": userId}) + if err != nil { + result.Err = model.NewAppError("SqlChannelStore.RemoveMember", "store.sql_channel.remove_member.app_error", nil, "channel_id="+channelId+", user_id="+userId+", "+err.Error(), http.StatusInternalServerError) } }) } |