summaryrefslogtreecommitdiffstats
path: root/app/notification.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/notification.go')
-rw-r--r--app/notification.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/app/notification.go b/app/notification.go
index 8cb63fbaf..bb0c8703f 100644
--- a/app/notification.go
+++ b/app/notification.go
@@ -55,10 +55,15 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
if channel.Type == model.CHANNEL_DIRECT {
var otherUserId string
- if userIds := strings.Split(channel.Name, "__"); userIds[0] == post.UserId {
- otherUserId = userIds[1]
- } else {
- otherUserId = userIds[0]
+
+ userIds := strings.Split(channel.Name, "__")
+
+ if userIds[0] != userIds[1] {
+ if userIds[0] == post.UserId {
+ otherUserId = userIds[1]
+ } else {
+ otherUserId = userIds[0]
+ }
}
if _, ok := profileMap[otherUserId]; ok {
@@ -89,7 +94,7 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
delete(mentionedUserIds, post.UserId)
}
- if len(m.OtherPotentialMentions) > 0 {
+ if len(m.OtherPotentialMentions) > 0 && !post.IsSystemMessage() {
if result := <-a.Srv.Store.User().GetProfilesByUsernames(m.OtherPotentialMentions, team.Id); result.Err == nil {
outOfChannelMentions := result.Data.([]*model.User)
if channel.Type != model.CHANNEL_GROUP {