summaryrefslogtreecommitdiffstats
path: root/app/notification_email.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/notification_email.go')
-rw-r--r--app/notification_email.go38
1 files changed, 19 insertions, 19 deletions
diff --git a/app/notification_email.go b/app/notification_email.go
index cfc1bb4fd..117988e2a 100644
--- a/app/notification_email.go
+++ b/app/notification_email.go
@@ -22,27 +22,28 @@ func (a *App) sendNotificationEmail(notification *postNotification, user *model.
post := notification.post
if channel.IsGroupOrDirect() {
- if result := <-a.Srv.Store.Team().GetTeamsByUserId(user.Id); result.Err != nil {
+ result := <-a.Srv.Store.Team().GetTeamsByUserId(user.Id)
+ if result.Err != nil {
return result.Err
- } else {
- // if the recipient isn't in the current user's team, just pick one
- teams := result.Data.([]*model.Team)
- found := false
-
- for i := range teams {
- if teams[i].Id == team.Id {
- found = true
- break
- }
- }
+ }
+
+ // if the recipient isn't in the current user's team, just pick one
+ teams := result.Data.([]*model.Team)
+ found := false
- 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: a.Config().TeamSettings.SiteName}
+ for i := range teams {
+ if teams[i].Id == team.Id {
+ found = true
+ 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: a.Config().TeamSettings.SiteName}
+ }
}
if *a.Config().EmailSettings.EnableEmailBatching {
@@ -357,7 +358,6 @@ func (a *App) GetMessageForNotification(post *model.Post, translateFunc i18n.Tra
if onlyImages {
return translateFunc("api.post.get_message_for_notification.images_sent", len(filenames), props)
- } else {
- return translateFunc("api.post.get_message_for_notification.files_sent", len(filenames), props)
}
+ return translateFunc("api.post.get_message_for_notification.files_sent", len(filenames), props)
}