From 55c148b59a058f3845345a45c7aa33371a96e971 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Mon, 20 Jul 2015 17:49:13 -0400 Subject: Added additional check when adding a message to an email notification for a blank post and corrected a comment --- api/post.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'api') 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 -- cgit v1.2.3-1-g7c22