summaryrefslogtreecommitdiffstats
path: root/api4
diff options
context:
space:
mode:
Diffstat (limited to 'api4')
-rw-r--r--api4/apitestlib.go2
-rw-r--r--api4/channel.go6
-rw-r--r--api4/channel_test.go2
-rw-r--r--api4/post.go3
-rw-r--r--api4/team.go2
-rw-r--r--api4/user.go2
6 files changed, 8 insertions, 9 deletions
diff --git a/api4/apitestlib.go b/api4/apitestlib.go
index fbad3d6be..64d3f22b2 100644
--- a/api4/apitestlib.go
+++ b/api4/apitestlib.go
@@ -327,7 +327,7 @@ func (me *TestHelper) UpdateActiveUser(user *model.User, active bool) {
func LinkUserToTeam(user *model.User, team *model.Team) {
utils.DisableDebugLogForTest()
- err := app.JoinUserToTeam(team, user)
+ err := app.JoinUserToTeam(team, user, utils.GetSiteURL())
if err != nil {
l4g.Error(err.Error())
l4g.Close()
diff --git a/api4/channel.go b/api4/channel.go
index 5ed63320b..bd1710975 100644
--- a/api4/channel.go
+++ b/api4/channel.go
@@ -131,7 +131,7 @@ func updateChannel(c *Context, w http.ResponseWriter, r *http.Request) {
return
} else {
if oldChannelDisplayName != channel.DisplayName {
- if err := app.PostUpdateChannelDisplayNameMessage(c.Session.UserId, channel.Id, c.Params.TeamId, oldChannelDisplayName, channel.DisplayName); err != nil {
+ if err := app.PostUpdateChannelDisplayNameMessage(c.Session.UserId, channel.Id, c.Params.TeamId, oldChannelDisplayName, channel.DisplayName, c.GetSiteURL()); err != nil {
l4g.Error(err.Error())
}
}
@@ -302,7 +302,7 @@ func deleteChannel(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- err = app.DeleteChannel(channel, c.Session.UserId)
+ err = app.DeleteChannel(channel, c.Session.UserId, c.GetSiteURL())
if err != nil {
c.Err = err
return
@@ -521,7 +521,7 @@ func removeChannelMember(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if err = app.RemoveUserFromChannel(c.Params.UserId, c.Session.UserId, channel); err != nil {
+ if err = app.RemoveUserFromChannel(c.Params.UserId, c.Session.UserId, channel, c.GetSiteURL()); err != nil {
c.Err = err
return
}
diff --git a/api4/channel_test.go b/api4/channel_test.go
index bf7218f0b..6d5b5cef3 100644
--- a/api4/channel_test.go
+++ b/api4/channel_test.go
@@ -426,7 +426,7 @@ func TestDeleteChannel(t *testing.T) {
if ch, err := app.GetChannel(publicChannel1.Id); err == nil && ch.DeleteAt == 0 {
t.Fatal("should have failed to get deleted channel")
- } else if err := app.JoinChannel(ch, user2.Id); err == nil {
+ } else if err := app.JoinChannel(ch, user2.Id, ""); err == nil {
t.Fatal("should have failed to join deleted channel")
}
diff --git a/api4/post.go b/api4/post.go
index 4632cb6df..a43f2f20f 100644
--- a/api4/post.go
+++ b/api4/post.go
@@ -45,7 +45,7 @@ func createPost(c *Context, w http.ResponseWriter, r *http.Request) {
post.CreateAt = 0
}
- rp, err := app.CreatePostAsUser(post)
+ rp, err := app.CreatePostAsUser(post, c.GetSiteURL())
if err != nil {
c.Err = err
return
@@ -224,4 +224,3 @@ func getFileInfosForPost(c *Context, w http.ResponseWriter, r *http.Request) {
w.Write([]byte(model.FileInfosToJson(infos)))
}
}
-
diff --git a/api4/team.go b/api4/team.go
index ed4929326..1e63273e6 100644
--- a/api4/team.go
+++ b/api4/team.go
@@ -46,7 +46,7 @@ func createTeam(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- rteam, err := app.CreateTeamWithUser(team, c.Session.UserId)
+ rteam, err := app.CreateTeamWithUser(team, c.Session.UserId, c.GetSiteURL())
if err != nil {
c.Err = err
return
diff --git a/api4/user.go b/api4/user.go
index 7b8bfe65e..1668f9c2c 100644
--- a/api4/user.go
+++ b/api4/user.go
@@ -62,7 +62,7 @@ func createUser(c *Context, w http.ResponseWriter, r *http.Request) {
var ruser *model.User
var err *model.AppError
if len(hash) > 0 {
- ruser, err = app.CreateUserWithHash(user, hash, r.URL.Query().Get("d"))
+ ruser, err = app.CreateUserWithHash(user, hash, r.URL.Query().Get("d"), c.GetSiteURL())
} else if len(inviteId) > 0 {
ruser, err = app.CreateUserWithInviteId(user, inviteId, c.GetSiteURL())
} else {