From bf2038bc41b81d56e15e712f1e6c2bf6c7dd917d Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Thu, 15 Mar 2018 15:42:49 +0100 Subject: [MM-9703] Push notifications are sent for own DM's (#8439) update --- app/notification.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'app/notification.go') diff --git a/app/notification.go b/app/notification.go index 9a8096bbf..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 { -- cgit v1.2.3-1-g7c22