summaryrefslogtreecommitdiffstats
path: root/api/team.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-06-29 09:07:13 -0400
committerJoramWilander <jwawilander@gmail.com>2015-06-29 09:07:13 -0400
commitcebb4bef843e848531bdf3465f49bd0d995efa8e (patch)
tree28f8c7052b6958ba2daf4881f9fe24a0b1a04e47 /api/team.go
parent0792eb18d535410b456f3cc569e243efb85a47b6 (diff)
downloadchat-cebb4bef843e848531bdf3465f49bd0d995efa8e.tar.gz
chat-cebb4bef843e848531bdf3465f49bd0d995efa8e.tar.bz2
chat-cebb4bef843e848531bdf3465f49bd0d995efa8e.zip
move default channel creation to seperate func and add off-topic
Diffstat (limited to 'api/team.go')
-rw-r--r--api/team.go14
1 files changed, 2 insertions, 12 deletions
diff --git a/api/team.go b/api/team.go
index 775bc29ae..e4206505d 100644
--- a/api/team.go
+++ b/api/team.go
@@ -146,12 +146,7 @@ func createTeamFromSignup(c *Context, w http.ResponseWriter, r *http.Request) {
} else {
rteam := result.Data.(*model.Team)
- channel := &model.Channel{DisplayName: "Town Square", Name: "town-square", Type: model.CHANNEL_OPEN, TeamId: rteam.Id}
-
- if _, err := CreateChannel(c, channel, r.URL.Path, false); err != nil {
- c.Err = err
- return
- }
+ CreateDefaultChannels(c, rteam.Id)
teamSignup.User.TeamId = rteam.Id
teamSignup.User.EmailVerified = true
@@ -197,12 +192,7 @@ func createTeam(c *Context, w http.ResponseWriter, r *http.Request) {
} else {
rteam := result.Data.(*model.Team)
- channel := &model.Channel{DisplayName: "Town Square", Name: "town-square", Type: model.CHANNEL_OPEN, TeamId: rteam.Id}
-
- if _, err := CreateChannel(c, channel, r.URL.Path, false); err != nil {
- c.Err = err
- return
- }
+ CreateDefaultChannels(c, rteam.Id)
if rteam.AllowValet {
CreateValet(c, rteam)