diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-07-20 17:49:13 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-07-20 17:49:32 -0400 |
commit | 55c148b59a058f3845345a45c7aa33371a96e971 (patch) | |
tree | c173d36885352ab03b138507ef84655c879ebe26 /api | |
parent | d502d82016e4a35325351fe9d31fcefe907b17d7 (diff) | |
download | chat-55c148b59a058f3845345a45c7aa33371a96e971.tar.gz chat-55c148b59a058f3845345a45c7aa33371a96e971.tar.bz2 chat-55c148b59a058f3845345a45c7aa33371a96e971.zip |
Added additional check when adding a message to an email notification for a blank post and corrected a comment
Diffstat (limited to 'api')
-rw-r--r-- | api/post.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/post.go b/api/post.go index 172347a46..1170d6a4f 100644 --- a/api/post.go +++ b/api/post.go @@ -405,8 +405,8 @@ func fireAndForgetNotifications(post *model.Post, teamId, teamUrl string) { bodyPage.Props["PostMessage"] = model.ClearMentionTags(post.Message) bodyPage.Props["TeamLink"] = teamUrl + "/channels/" + channel.Name - // attempt to fill in a message body based if the message has none - if len(strings.TrimSpace(bodyPage.Props["PostMessage"])) == 0 { + // attempt to fill in a message body if the post doesn't have any text + if len(strings.TrimSpace(bodyPage.Props["PostMessage"])) == 0 && len(post.Filenames) > 0 { // extract the filenames from their paths and determine what type of files are attached filenames := make([]string, len(post.Filenames)) onlyImages := true |