summaryrefslogtreecommitdiffstats
path: root/store/sql_post_store.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-01-20 13:36:16 -0600
committerCorey Hulen <corey@hulen.com>2016-01-20 13:36:16 -0600
commitaefbb541d0d5bdd9919fef44fbf1a1fbfeaeb58b (patch)
treed87809ff2a306e5428b0ab6973d05509baa21abd /store/sql_post_store.go
parent0b1aff3b24b4ac2df8e963c83d6e52b127c603f9 (diff)
downloadchat-aefbb541d0d5bdd9919fef44fbf1a1fbfeaeb58b.tar.gz
chat-aefbb541d0d5bdd9919fef44fbf1a1fbfeaeb58b.tar.bz2
chat-aefbb541d0d5bdd9919fef44fbf1a1fbfeaeb58b.zip
Revert " PLT-7 adding loc for db calls"
Diffstat (limited to 'store/sql_post_store.go')
-rw-r--r--store/sql_post_store.go53
1 files changed, 26 insertions, 27 deletions
diff --git a/store/sql_post_store.go b/store/sql_post_store.go
index b48406261..40dca9930 100644
--- a/store/sql_post_store.go
+++ b/store/sql_post_store.go
@@ -11,7 +11,6 @@ import (
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
- goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type SqlPostStore struct {
@@ -51,7 +50,7 @@ func (s SqlPostStore) CreateIndexesIfNotExists() {
s.CreateFullTextIndexIfNotExists("idx_posts_hashtags_txt", "Posts", "Hashtags")
}
-func (s SqlPostStore) Save(T goi18n.TranslateFunc, post *model.Post) StoreChannel {
+func (s SqlPostStore) Save(post *model.Post) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -98,7 +97,7 @@ func (s SqlPostStore) Save(T goi18n.TranslateFunc, post *model.Post) StoreChanne
return storeChannel
}
-func (s SqlPostStore) Update(T goi18n.TranslateFunc, oldPost *model.Post, newMessage string, newHashtags string) StoreChannel {
+func (s SqlPostStore) Update(oldPost *model.Post, newMessage string, newHashtags string) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -143,7 +142,7 @@ func (s SqlPostStore) Update(T goi18n.TranslateFunc, oldPost *model.Post, newMes
return storeChannel
}
-func (s SqlPostStore) Get(T goi18n.TranslateFunc, id string) StoreChannel {
+func (s SqlPostStore) Get(id string) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -189,7 +188,7 @@ type etagPosts struct {
UpdateAt int64
}
-func (s SqlPostStore) GetEtag(T goi18n.TranslateFunc, channelId string) StoreChannel {
+func (s SqlPostStore) GetEtag(channelId string) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -210,7 +209,7 @@ func (s SqlPostStore) GetEtag(T goi18n.TranslateFunc, channelId string) StoreCha
return storeChannel
}
-func (s SqlPostStore) Delete(T goi18n.TranslateFunc, postId string, time int64) StoreChannel {
+func (s SqlPostStore) Delete(postId string, time int64) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -228,7 +227,7 @@ func (s SqlPostStore) Delete(T goi18n.TranslateFunc, postId string, time int64)
return storeChannel
}
-func (s SqlPostStore) permanentDelete(T goi18n.TranslateFunc, postId string) StoreChannel {
+func (s SqlPostStore) permanentDelete(postId string) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -246,7 +245,7 @@ func (s SqlPostStore) permanentDelete(T goi18n.TranslateFunc, postId string) Sto
return storeChannel
}
-func (s SqlPostStore) permanentDeleteAllCommentByUser(T goi18n.TranslateFunc, userId string) StoreChannel {
+func (s SqlPostStore) permanentDeleteAllCommentByUser(userId string) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -264,14 +263,14 @@ func (s SqlPostStore) permanentDeleteAllCommentByUser(T goi18n.TranslateFunc, us
return storeChannel
}
-func (s SqlPostStore) PermanentDeleteByUser(T goi18n.TranslateFunc, userId string) StoreChannel {
+func (s SqlPostStore) PermanentDeleteByUser(userId string) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
result := StoreResult{}
// First attempt to delete all the comments for a user
- if r := <-s.permanentDeleteAllCommentByUser(T, userId); r.Err != nil {
+ if r := <-s.permanentDeleteAllCommentByUser(userId); r.Err != nil {
result.Err = r.Err
storeChannel <- result
close(storeChannel)
@@ -295,7 +294,7 @@ func (s SqlPostStore) PermanentDeleteByUser(T goi18n.TranslateFunc, userId strin
found = false
for _, id := range ids {
found = true
- if r := <-s.permanentDelete(T, id); r.Err != nil {
+ if r := <-s.permanentDelete(id); r.Err != nil {
result.Err = r.Err
storeChannel <- result
close(storeChannel)
@@ -321,7 +320,7 @@ func (s SqlPostStore) PermanentDeleteByUser(T goi18n.TranslateFunc, userId strin
return storeChannel
}
-func (s SqlPostStore) GetPosts(T goi18n.TranslateFunc, channelId string, offset int, limit int) StoreChannel {
+func (s SqlPostStore) GetPosts(channelId string, offset int, limit int) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -334,8 +333,8 @@ func (s SqlPostStore) GetPosts(T goi18n.TranslateFunc, channelId string, offset
return
}
- rpc := s.getRootPosts(T, channelId, offset, limit)
- cpc := s.getParentsPosts(T, channelId, offset, limit)
+ rpc := s.getRootPosts(channelId, offset, limit)
+ cpc := s.getParentsPosts(channelId, offset, limit)
if rpr := <-rpc; rpr.Err != nil {
result.Err = rpr.Err
@@ -368,7 +367,7 @@ func (s SqlPostStore) GetPosts(T goi18n.TranslateFunc, channelId string, offset
return storeChannel
}
-func (s SqlPostStore) GetPostsSince(T goi18n.TranslateFunc, channelId string, time int64) StoreChannel {
+func (s SqlPostStore) GetPostsSince(channelId string, time int64) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -426,15 +425,15 @@ func (s SqlPostStore) GetPostsSince(T goi18n.TranslateFunc, channelId string, ti
return storeChannel
}
-func (s SqlPostStore) GetPostsBefore(T goi18n.TranslateFunc, channelId string, postId string, numPosts int, offset int) StoreChannel {
- return s.getPostsAround(T, channelId, postId, numPosts, offset, true)
+func (s SqlPostStore) GetPostsBefore(channelId string, postId string, numPosts int, offset int) StoreChannel {
+ return s.getPostsAround(channelId, postId, numPosts, offset, true)
}
-func (s SqlPostStore) GetPostsAfter(T goi18n.TranslateFunc, channelId string, postId string, numPosts int, offset int) StoreChannel {
- return s.getPostsAround(T, channelId, postId, numPosts, offset, false)
+func (s SqlPostStore) GetPostsAfter(channelId string, postId string, numPosts int, offset int) StoreChannel {
+ return s.getPostsAround(channelId, postId, numPosts, offset, false)
}
-func (s SqlPostStore) getPostsAround(T goi18n.TranslateFunc, channelId string, postId string, numPosts int, offset int, before bool) StoreChannel {
+func (s SqlPostStore) getPostsAround(channelId string, postId string, numPosts int, offset int, before bool) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -524,7 +523,7 @@ func (s SqlPostStore) getPostsAround(T goi18n.TranslateFunc, channelId string, p
return storeChannel
}
-func (s SqlPostStore) getRootPosts(T goi18n.TranslateFunc, channelId string, offset int, limit int) StoreChannel {
+func (s SqlPostStore) getRootPosts(channelId string, offset int, limit int) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -545,7 +544,7 @@ func (s SqlPostStore) getRootPosts(T goi18n.TranslateFunc, channelId string, off
return storeChannel
}
-func (s SqlPostStore) getParentsPosts(T goi18n.TranslateFunc, channelId string, offset int, limit int) StoreChannel {
+func (s SqlPostStore) getParentsPosts(channelId string, offset int, limit int) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -601,7 +600,7 @@ var specialSearchChar = []string{
"@",
}
-func (s SqlPostStore) Search(T goi18n.TranslateFunc, teamId string, userId string, params *model.SearchParams) StoreChannel {
+func (s SqlPostStore) Search(teamId string, userId string, params *model.SearchParams) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -766,7 +765,7 @@ func (s SqlPostStore) Search(T goi18n.TranslateFunc, teamId string, userId strin
return storeChannel
}
-func (s SqlPostStore) GetForExport(T goi18n.TranslateFunc, channelId string) StoreChannel {
+func (s SqlPostStore) GetForExport(channelId string) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -790,7 +789,7 @@ func (s SqlPostStore) GetForExport(T goi18n.TranslateFunc, channelId string) Sto
return storeChannel
}
-func (s SqlPostStore) AnalyticsUserCountsWithPostsByDay(T goi18n.TranslateFunc, teamId string) StoreChannel {
+func (s SqlPostStore) AnalyticsUserCountsWithPostsByDay(teamId string) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -854,7 +853,7 @@ func (s SqlPostStore) AnalyticsUserCountsWithPostsByDay(T goi18n.TranslateFunc,
return storeChannel
}
-func (s SqlPostStore) AnalyticsPostCountsByDay(T goi18n.TranslateFunc, teamId string) StoreChannel {
+func (s SqlPostStore) AnalyticsPostCountsByDay(teamId string) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
@@ -919,7 +918,7 @@ func (s SqlPostStore) AnalyticsPostCountsByDay(T goi18n.TranslateFunc, teamId st
return storeChannel
}
-func (s SqlPostStore) AnalyticsPostCount(T goi18n.TranslateFunc, teamId string) StoreChannel {
+func (s SqlPostStore) AnalyticsPostCount(teamId string) StoreChannel {
storeChannel := make(StoreChannel)
go func() {