Merge branch 'release-3.9' into merge-3.9

Этот коммит содержится в:
JoramWilander
2017-05-12 08:00:28 -04:00
родитель b1c39204a6 a21a06afd9
Коммит 9d109b0700
66 изменённых файлов: 799 добавлений и 494 удалений

Просмотреть файл

@@ -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)
}
@@ -1021,9 +1025,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
@@ -1033,6 +1041,10 @@ func SetActiveChannel(userId string, channelId string) *model.AppError {
AddStatusCache(status)
if status.Status != oldStatus {
BroadcastStatus(status)
}
return nil
}