diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-07-15 11:20:39 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-07-15 11:20:39 -0400 |
commit | 942ae4c5278e0a3064ef08937063ec66a6a8e990 (patch) | |
tree | 595514b6619988c72250ac2bf924cc103887f948 /store | |
parent | b339b5c982a336abcc0a1f1bc9ba68e447472228 (diff) | |
download | chat-942ae4c5278e0a3064ef08937063ec66a6a8e990.tar.gz chat-942ae4c5278e0a3064ef08937063ec66a6a8e990.tar.bz2 chat-942ae4c5278e0a3064ef08937063ec66a6a8e990.zip |
Cleaning up old export code (#3601)
Diffstat (limited to 'store')
-rw-r--r-- | store/sql_channel_store.go | 22 | ||||
-rw-r--r-- | store/sql_post_store.go | 24 | ||||
-rw-r--r-- | store/sql_user_store.go | 28 | ||||
-rw-r--r-- | store/store.go | 3 |
4 files changed, 0 insertions, 77 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go index 2b356d0de..463bc0678 100644 --- a/store/sql_channel_store.go +++ b/store/sql_channel_store.go @@ -982,28 +982,6 @@ func (s SqlChannelStore) IncrementMentionCount(channelId string, userId string) return storeChannel } -func (s SqlChannelStore) GetForExport(teamId string) StoreChannel { - storeChannel := make(StoreChannel) - - go func() { - result := StoreResult{} - - var data []*model.Channel - _, err := s.GetReplica().Select(&data, "SELECT * FROM Channels WHERE TeamId = :TeamId AND DeleteAt = 0 AND Type = 'O'", map[string]interface{}{"TeamId": teamId}) - - if err != nil { - result.Err = model.NewLocAppError("SqlChannelStore.GetAllChannels", "store.sql_channel.get_for_export.app_error", nil, "teamId="+teamId+", err="+err.Error()) - } else { - result.Data = data - } - - storeChannel <- result - close(storeChannel) - }() - - return storeChannel -} - func (s SqlChannelStore) GetAll(teamId string) StoreChannel { storeChannel := make(StoreChannel) diff --git a/store/sql_post_store.go b/store/sql_post_store.go index e6291687e..57bb2a512 100644 --- a/store/sql_post_store.go +++ b/store/sql_post_store.go @@ -784,30 +784,6 @@ func (s SqlPostStore) Search(teamId string, userId string, params *model.SearchP return storeChannel } -func (s SqlPostStore) GetForExport(channelId string) StoreChannel { - storeChannel := make(StoreChannel) - - go func() { - result := StoreResult{} - - var posts []*model.Post - _, err := s.GetReplica().Select( - &posts, - "SELECT * FROM Posts WHERE ChannelId = :ChannelId AND DeleteAt = 0", - map[string]interface{}{"ChannelId": channelId}) - if err != nil { - result.Err = model.NewLocAppError("SqlPostStore.GetForExport", "store.sql_post.get_for_export.app_error", nil, "channelId="+channelId+err.Error()) - } else { - result.Data = posts - } - - storeChannel <- result - close(storeChannel) - }() - - return storeChannel -} - func (s SqlPostStore) AnalyticsUserCountsWithPostsByDay(teamId string) StoreChannel { storeChannel := make(StoreChannel) diff --git a/store/sql_user_store.go b/store/sql_user_store.go index 7c716db67..325008670 100644 --- a/store/sql_user_store.go +++ b/store/sql_user_store.go @@ -969,34 +969,6 @@ func (us SqlUserStore) VerifyEmail(userId string) StoreChannel { return storeChannel } -func (us SqlUserStore) GetForExport(teamId string) StoreChannel { - - storeChannel := make(StoreChannel) - - go func() { - result := StoreResult{} - - var users []*model.User - - if _, err := us.GetReplica().Select(&users, "SELECT Users.* FROM Users, TeamMembers WHERE TeamMembers.TeamId = :TeamId AND Users.Id = TeamMembers.UserId", map[string]interface{}{"TeamId": teamId}); err != nil { - result.Err = model.NewLocAppError("SqlUserStore.GetForExport", "store.sql_user.get_for_export.app_error", nil, err.Error()) - } else { - for _, u := range users { - u.Password = "" - u.AuthData = new(string) - *u.AuthData = "" - } - - result.Data = users - } - - storeChannel <- result - close(storeChannel) - }() - - return storeChannel -} - func (us SqlUserStore) GetTotalUsersCount() StoreChannel { storeChannel := make(StoreChannel) diff --git a/store/store.go b/store/store.go index 0c19fd5b6..4b5c0e8cd 100644 --- a/store/store.go +++ b/store/store.go @@ -83,7 +83,6 @@ type ChannelStore interface { GetChannels(teamId string, userId string) StoreChannel GetMoreChannels(teamId string, userId string) StoreChannel GetChannelCounts(teamId string, userId string) StoreChannel - GetForExport(teamId string) StoreChannel GetAll(teamId string) StoreChannel SaveMember(member *model.ChannelMember) StoreChannel @@ -117,7 +116,6 @@ type PostStore interface { GetPostsSince(channelId string, time int64) StoreChannel GetEtag(channelId string) StoreChannel Search(teamId string, userId string, params *model.SearchParams) StoreChannel - GetForExport(channelId string) StoreChannel AnalyticsUserCountsWithPostsByDay(teamId string) StoreChannel AnalyticsPostCountsByDay(teamId string) StoreChannel AnalyticsPostCount(teamId string, mustHaveFile bool, mustHaveHashtag bool) StoreChannel @@ -151,7 +149,6 @@ type UserStore interface { GetEtagForProfiles(teamId string) StoreChannel GetEtagForDirectProfiles(userId string) StoreChannel UpdateFailedPasswordAttempts(userId string, attempts int) StoreChannel - GetForExport(teamId string) StoreChannel GetTotalUsersCount() StoreChannel GetTotalActiveUsersCount() StoreChannel GetSystemAdminProfiles() StoreChannel |