diff options
Diffstat (limited to 'app/notification.go')
-rw-r--r-- | app/notification.go | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/app/notification.go b/app/notification.go index 5b7ed5ad2..2d56d294a 100644 --- a/app/notification.go +++ b/app/notification.go @@ -66,13 +66,25 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod } } - if _, ok := profileMap[otherUserId]; ok { + otherUser, ok := profileMap[otherUserId] + if ok { mentionedUserIds[otherUserId] = true } if post.Props["from_webhook"] == "true" { mentionedUserIds[post.UserId] = true } + + if post.Type != model.POST_AUTO_RESPONDER { + a.Go(func() { + rootId := post.Id + if post.RootId != "" && post.RootId != post.Id { + rootId = post.RootId + } + a.SendAutoResponse(channel, otherUser, rootId) + }) + } + } else { keywords := a.GetMentionKeywordsInChannel(profileMap, post.Type != model.POST_HEADER_CHANGE && post.Type != model.POST_PURPOSE_CHANGE) @@ -842,15 +854,15 @@ func GetExplicitMentions(message string, keywords map[string][]string) *Explicit checkForMention := func(word string) bool { isMention := false - if word == "@here" { + if strings.ToLower(word) == "@here" { ret.HereMentioned = true } - if word == "@channel" { + if strings.ToLower(word) == "@channel" { ret.ChannelMentioned = true } - if word == "@all" { + if strings.ToLower(word) == "@all" { ret.AllMentioned = true } @@ -1021,8 +1033,8 @@ func DoesNotifyPropsAllowPushNotification(user *model.User, channelNotifyProps m } func DoesStatusAllowPushNotification(userNotifyProps model.StringMap, status *model.Status, channelId string) bool { - // If User status is DND return false right away - if status.Status == model.STATUS_DND { + // If User status is DND or OOO return false right away + if status.Status == model.STATUS_DND || status.Status == model.STATUS_OUT_OF_OFFICE { return false } |