summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-01-10 16:17:08 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2017-01-10 16:17:08 -0500
commit5be99e1f85fff344485b6750be43a3506d8f8341 (patch)
tree9c549382504a95b0d788a9c4fe58a23672ea1814 /api
parent189a745030871d013883f9ae66b7cb556d85bf24 (diff)
downloadchat-5be99e1f85fff344485b6750be43a3506d8f8341.tar.gz
chat-5be99e1f85fff344485b6750be43a3506d8f8341.tar.bz2
chat-5be99e1f85fff344485b6750be43a3506d8f8341.zip
Fixing DM channel emails (#5038)
Diffstat (limited to 'api')
-rw-r--r--api/post.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/api/post.go b/api/post.go
index 45ead08e0..8b5a33224 100644
--- a/api/post.go
+++ b/api/post.go
@@ -905,15 +905,18 @@ func sendNotificationEmail(c *Context, post *model.Post, user *model.User, chann
for i := range teams {
if teams[i].Id == team.Id {
found = true
+ team = teams[i]
break
}
}
- if !found && len(teams) > 0 {
- team = teams[0]
- } else {
- // in case the user hasn't joined any teams we send them to the select_team page
- team = &model.Team{Name: "select_team", DisplayName: utils.Cfg.TeamSettings.SiteName}
+ if !found {
+ if len(teams) > 0 {
+ team = teams[0]
+ } else {
+ // in case the user hasn't joined any teams we send them to the select_team page
+ team = &model.Team{Name: "select_team", DisplayName: utils.Cfg.TeamSettings.SiteName}
+ }
}
}
}