From 75f8729e2d25467500778e633c45c97e78a8f7a0 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Wed, 20 Jan 2016 12:43:44 -0600 Subject: PLT-7 adding loc db calls for users table --- api/channel.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'api/channel.go') diff --git a/api/channel.go b/api/channel.go index 39ea62f2b..476c20909 100644 --- a/api/channel.go +++ b/api/channel.go @@ -125,7 +125,7 @@ func CreateDirectChannel(c *Context, otherUserId string) (*model.Channel, *model return nil, model.NewAppError("CreateDirectChannel", "Invalid other user id ", otherUserId) } - uc := Srv.Store.User().Get(otherUserId) + uc := Srv.Store.User().Get(c.T, otherUserId) channel := new(model.Channel) @@ -292,7 +292,7 @@ func updateChannelHeader(c *Context, w http.ResponseWriter, r *http.Request) { func PostUpdateChannelHeaderMessageAndForget(c *Context, channelId string, oldChannelHeader, newChannelHeader string) { go func() { - uc := Srv.Store.User().Get(c.Session.UserId) + uc := Srv.Store.User().Get(c.T, c.Session.UserId) if uresult := <-uc; uresult.Err != nil { l4g.Error("Failed to retrieve user while trying to save update channel header message %v", uresult.Err) @@ -371,7 +371,7 @@ func getChannels(c *Context, w http.ResponseWriter, r *http.Request) { if result := <-Srv.Store.Channel().GetChannels(c.T, c.Session.TeamId, c.Session.UserId); result.Err != nil { if result.Err.Message == "No channels were found" { // lets make sure the user is valid - if result := <-Srv.Store.User().Get(c.Session.UserId); result.Err != nil { + if result := <-Srv.Store.User().Get(c.T, c.Session.UserId); result.Err != nil { c.Err = result.Err c.RemoveSessionCookie(w, r) l4g.Error("Error in getting users profile for id=%v forcing logout", c.Session.UserId) @@ -440,7 +440,7 @@ func join(c *Context, w http.ResponseWriter, r *http.Request) { func JoinChannel(c *Context, channelId string, role string) { sc := Srv.Store.Channel().Get(c.T, channelId) - uc := Srv.Store.User().Get(c.Session.UserId) + uc := Srv.Store.User().Get(c.T, c.Session.UserId) if cresult := <-sc; cresult.Err != nil { c.Err = cresult.Err @@ -544,7 +544,7 @@ func leave(c *Context, w http.ResponseWriter, r *http.Request) { id := params["id"] sc := Srv.Store.Channel().Get(c.T, id) - uc := Srv.Store.User().Get(c.Session.UserId) + uc := Srv.Store.User().Get(c.T, c.Session.UserId) if cresult := <-sc; cresult.Err != nil { c.Err = cresult.Err @@ -594,7 +594,7 @@ func deleteChannel(c *Context, w http.ResponseWriter, r *http.Request) { sc := Srv.Store.Channel().Get(c.T, id) scm := Srv.Store.Channel().GetMember(c.T, id, c.Session.UserId) - uc := Srv.Store.User().Get(c.Session.UserId) + uc := Srv.Store.User().Get(c.T, c.Session.UserId) ihc := Srv.Store.Webhook().GetIncomingByChannel(c.T, id) ohc := Srv.Store.Webhook().GetOutgoingByChannel(c.T, id) @@ -818,8 +818,8 @@ func addMember(c *Context, w http.ResponseWriter, r *http.Request) { cchan := Srv.Store.Channel().CheckPermissionsTo(c.T, c.Session.TeamId, id, c.Session.UserId) sc := Srv.Store.Channel().Get(c.T, id) - ouc := Srv.Store.User().Get(c.Session.UserId) - nuc := Srv.Store.User().Get(userId) + ouc := Srv.Store.User().Get(c.T, c.Session.UserId) + nuc := Srv.Store.User().Get(c.T, userId) // Only need to be a member of the channel to add a new member if !c.HasPermissionsToChannel(cchan, "addMember") { -- cgit v1.2.3-1-g7c22