summaryrefslogtreecommitdiffstats
path: root/app/channel.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-05-09 16:01:06 -0400
committerGitHub <noreply@github.com>2017-05-09 16:01:06 -0400
commit8c8d9dbf8fa3b4ebf640bf5e1a71f9c04b57e111 (patch)
tree3de51f879e798045076e075c3fedf3cd73094415 /app/channel.go
parentc8a4a8c6e6b04ff4f8f6d8e9c632b63b3cf74f42 (diff)
downloadchat-8c8d9dbf8fa3b4ebf640bf5e1a71f9c04b57e111.tar.gz
chat-8c8d9dbf8fa3b4ebf640bf5e1a71f9c04b57e111.tar.bz2
chat-8c8d9dbf8fa3b4ebf640bf5e1a71f9c04b57e111.zip
Forward port 3.8.1 changes that missed master (#6362)
Diffstat (limited to 'app/channel.go')
-rw-r--r--app/channel.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/channel.go b/app/channel.go
index ee53ace45..3e794a0c9 100644
--- a/app/channel.go
+++ b/app/channel.go
@@ -218,7 +218,7 @@ func WaitForChannelMembership(channelId string, userId string) {
}
}
-func CreateGroupChannel(userIds []string) (*model.Channel, *model.AppError) {
+func CreateGroupChannel(userIds []string, creatorId string) (*model.Channel, *model.AppError) {
if len(userIds) > model.CHANNEL_GROUP_MAX_USERS || len(userIds) < model.CHANNEL_GROUP_MIN_USERS {
return nil, model.NewAppError("CreateGroupChannel", "api.channel.create_group.bad_size.app_error", nil, "", http.StatusBadRequest)
}
@@ -261,6 +261,10 @@ func CreateGroupChannel(userIds []string) (*model.Channel, *model.AppError) {
return nil, result.Err
}
+ if user.Id == creatorId {
+ WaitForChannelMembership(group.Id, creatorId)
+ }
+
InvalidateCacheForUser(user.Id)
}