diff options
author | =Corey Hulen <corey@hulen.com> | 2015-12-04 14:51:49 -0800 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-12-04 14:51:49 -0800 |
commit | 25b3770607e47a3973ab4a109a43a455ea466130 (patch) | |
tree | 03066273daa5ff7a0435f54772ea586764a88e70 /api | |
parent | 9435bd254b80bd0f75d8045b96b349a3be1d9308 (diff) | |
download | chat-25b3770607e47a3973ab4a109a43a455ea466130.tar.gz chat-25b3770607e47a3973ab4a109a43a455ea466130.tar.bz2 chat-25b3770607e47a3973ab4a109a43a455ea466130.zip |
Fixing message
Diffstat (limited to 'api')
-rw-r--r-- | api/post.go | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/api/post.go b/api/post.go index 183a6444b..e1adc1d98 100644 --- a/api/post.go +++ b/api/post.go @@ -565,29 +565,7 @@ func sendNotificationsAndForget(c *Context, post *model.Post, team *model.Team, msg.DeviceId = strings.TrimPrefix(session.DeviceId, "apple:") msg.ServerId = utils.CfgDiagnosticId - if len(post.Message) == 0 { - - otherFile := true - - if len(post.Filenames) != 0 { - for _, filename := range post.Filenames { - ext := filepath.Ext(filename) - if model.IsFileExtImage(ext) { - otherFile = false - break - } - } - } - - if otherFile { - msg.Message = profileMap[id].FirstName + " uploaded a file in " + channel.DisplayName - } else { - msg.Message = profileMap[id].FirstName + " uploaded an image in " + channel.DisplayName - } - - } else { - msg.Message = profileMap[id].FirstName + " wrote in " + channel.DisplayName - } + msg.Message = profileMap[id].FirstName + " mentioned you in " + channel.DisplayName httpClient := http.Client{} request, _ := http.NewRequest("POST", *utils.Cfg.EmailSettings.PushNotificationServer+"/api/v1/send_push", strings.NewReader(msg.ToJson())) |