* Migration completed

* Fix tests

* Fix tests

* Fix tests

* Suggestions

* Trigger CI

* Suggestions

* Merge with master

* Migration completed

* Fix typo

* fix err check

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
Этот коммит содержится в:
Rodrigo Villablanca
2020-11-17 00:32:36 -03:00
коммит произвёл GitHub
родитель 2ebc8ec90f
Коммит 95221d9ace
14 изменённых файлов: 1524 добавлений и 816 удалений

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

@@ -789,7 +789,7 @@ func (a *App) allowGroupMentions(post *model.Post) bool {
// getGroupsAllowedForReferenceInChannel returns a map of groups allowed for reference in a given channel and team.
func (a *App) getGroupsAllowedForReferenceInChannel(channel *model.Channel, team *model.Team) (map[string]*model.Group, *model.AppError) {
var err *model.AppError
var err error
groupsMap := make(map[string]*model.Group)
opts := model.GroupSearchOpts{FilterAllowReference: true}
@@ -801,7 +801,7 @@ func (a *App) getGroupsAllowedForReferenceInChannel(channel *model.Channel, team
groups, err = a.Srv().Store.Group().GetGroupsByTeam(team.Id, opts)
}
if err != nil {
return nil, err
return nil, model.NewAppError("getGroupsAllowedForReferenceInChannel", "app.select_error", nil, err.Error(), http.StatusInternalServerError)
}
for _, group := range groups {
if group.Group.Name != nil {
@@ -813,7 +813,7 @@ func (a *App) getGroupsAllowedForReferenceInChannel(channel *model.Channel, team
groups, err := a.Srv().Store.Group().GetGroups(0, 0, opts)
if err != nil {
return nil, err
return nil, model.NewAppError("getGroupsAllowedForReferenceInChannel", "app.select_error", nil, err.Error(), http.StatusInternalServerError)
}
for _, group := range groups {
if group.Name != nil {
@@ -845,7 +845,7 @@ func (a *App) getMentionKeywordsInChannel(profiles map[string]*model.User, allow
// insertGroupMentions adds group members in the channel to Mentions, adds group members not in the channel to OtherPotentialMentions
// returns false if no group members present in the team that the channel belongs to
func (a *App) insertGroupMentions(group *model.Group, channel *model.Channel, profileMap map[string]*model.User, mentions *ExplicitMentions) (bool, *model.AppError) {
var err *model.AppError
var err error
var groupMembers []*model.User
outOfChannelGroupMembers := []*model.User{}
isGroupOrDirect := channel.IsGroupOrDirect()
@@ -857,7 +857,7 @@ func (a *App) insertGroupMentions(group *model.Group, channel *model.Channel, pr
}
if err != nil {
return false, err
return false, model.NewAppError("insertGroupMentions", "app.select_error", nil, err.Error(), http.StatusInternalServerError)
}
if mentions.Mentions == nil {