summaryrefslogtreecommitdiffstats
path: root/app/notification.go
diff options
context:
space:
mode:
authorCarlos Tadeu Panato Junior <ctadeu@gmail.com>2018-03-15 15:42:49 +0100
committerHarrison Healey <harrisonmhealey@gmail.com>2018-03-15 10:42:49 -0400
commitbf2038bc41b81d56e15e712f1e6c2bf6c7dd917d (patch)
treee03c251a0aae57cfd712719ad4b0068be4f87160 /app/notification.go
parent6830627faa881ffceb4549444c3f1bbfcb5684ab (diff)
downloadchat-bf2038bc41b81d56e15e712f1e6c2bf6c7dd917d.tar.gz
chat-bf2038bc41b81d56e15e712f1e6c2bf6c7dd917d.tar.bz2
chat-bf2038bc41b81d56e15e712f1e6c2bf6c7dd917d.zip
[MM-9703] Push notifications are sent for own DM's (#8439)
update
Diffstat (limited to 'app/notification.go')
-rw-r--r--app/notification.go13
1 files changed, 9 insertions, 4 deletions
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 {