[MM-32253] Fix "Cannot mark unread a DM message in a thread" (#16794)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
13616cac0f
Коммит
ff970e080b
@@ -837,7 +837,7 @@ func (a *App) getGroupsAllowedForReferenceInChannel(channel *model.Channel, team
|
|||||||
groupsMap := make(map[string]*model.Group)
|
groupsMap := make(map[string]*model.Group)
|
||||||
opts := model.GroupSearchOpts{FilterAllowReference: true}
|
opts := model.GroupSearchOpts{FilterAllowReference: true}
|
||||||
|
|
||||||
if channel.IsGroupConstrained() || team.IsGroupConstrained() {
|
if channel.IsGroupConstrained() || (team != nil && team.IsGroupConstrained()) {
|
||||||
var groups []*model.GroupWithSchemeAdmin
|
var groups []*model.GroupWithSchemeAdmin
|
||||||
if channel.IsGroupConstrained() {
|
if channel.IsGroupConstrained() {
|
||||||
groups, err = a.Srv().Store.Group().GetGroupsByChannel(channel.Id, opts)
|
groups, err = a.Srv().Store.Group().GetGroupsByChannel(channel.Id, opts)
|
||||||
|
|||||||
12
app/post.go
12
app/post.go
@@ -1343,10 +1343,6 @@ func (a *App) MaxPostSize() int {
|
|||||||
|
|
||||||
// countThreadMentions returns the number of times the user is mentioned in a specified thread after the timestamp.
|
// countThreadMentions returns the number of times the user is mentioned in a specified thread after the timestamp.
|
||||||
func (a *App) countThreadMentions(user *model.User, post *model.Post, teamId string, timestamp int64) (int64, *model.AppError) {
|
func (a *App) countThreadMentions(user *model.User, post *model.Post, teamId string, timestamp int64) (int64, *model.AppError) {
|
||||||
team, err := a.GetTeam(teamId)
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
channel, err := a.GetChannel(post.ChannelId)
|
channel, err := a.GetChannel(post.ChannelId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
@@ -1379,6 +1375,14 @@ func (a *App) countThreadMentions(user *model.User, post *model.Post, teamId str
|
|||||||
return int64(count), nil
|
return int64(count), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var team *model.Team
|
||||||
|
if teamId != "" {
|
||||||
|
team, err = a.GetTeam(teamId)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
groups, nErr := a.getGroupsAllowedForReferenceInChannel(channel, team)
|
groups, nErr := a.getGroupsAllowedForReferenceInChannel(channel, team)
|
||||||
if nErr != nil {
|
if nErr != nil {
|
||||||
return 0, model.NewAppError("countMentionsFromPost", "app.channel.count_posts_since.app_error", nil, nErr.Error(), http.StatusInternalServerError)
|
return 0, model.NewAppError("countMentionsFromPost", "app.channel.count_posts_since.app_error", nil, nErr.Error(), http.StatusInternalServerError)
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user