[MM-32253] Fix "Cannot mark unread a DM message in a thread" (#16794)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
13616cac0f
Коммит
ff970e080b
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.
|
||||
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)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
@@ -1379,6 +1375,14 @@ func (a *App) countThreadMentions(user *model.User, post *model.Post, teamId str
|
||||
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)
|
||||
if nErr != nil {
|
||||
return 0, model.NewAppError("countMentionsFromPost", "app.channel.count_posts_since.app_error", nil, nErr.Error(), http.StatusInternalServerError)
|
||||
|
||||
Ссылка в новой задаче
Block a user