summaryrefslogtreecommitdiffstats
path: root/app/notification.go
diff options
context:
space:
mode:
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 {