From 8c8d9dbf8fa3b4ebf640bf5e1a71f9c04b57e111 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 9 May 2017 16:01:06 -0400 Subject: Forward port 3.8.1 changes that missed master (#6362) --- app/channel.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/channel.go') 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) } -- cgit v1.2.3-1-g7c22 From be7c53ec7fffaa1751a162f4a34760f94e941bc6 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Thu, 11 May 2017 08:10:59 -0400 Subject: Send status change event if status changes on channel view (#6389) --- app/channel.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/channel.go') diff --git a/app/channel.go b/app/channel.go index 3e794a0c9..a1a70560d 100644 --- a/app/channel.go +++ b/app/channel.go @@ -1016,9 +1016,13 @@ func GetNumberOfChannelsOnTeam(teamId string) (int, *model.AppError) { func SetActiveChannel(userId string, channelId string) *model.AppError { status, err := GetStatus(userId) + + oldStatus := model.STATUS_OFFLINE + if err != nil { status = &model.Status{UserId: userId, Status: model.STATUS_ONLINE, Manual: false, LastActivityAt: model.GetMillis(), ActiveChannel: channelId} } else { + oldStatus = status.Status status.ActiveChannel = channelId if !status.Manual { status.Status = model.STATUS_ONLINE @@ -1028,6 +1032,10 @@ func SetActiveChannel(userId string, channelId string) *model.AppError { AddStatusCache(status) + if status.Status != oldStatus { + BroadcastStatus(status) + } + return nil } -- cgit v1.2.3-1-g7c22