From cc453a048d50e57802bab9363b59c2189143b784 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Tue, 8 Mar 2016 15:07:43 +0500 Subject: Multiple UI Improvements --- api/command.go | 11 +++++++---- api/file.go | 2 +- api/post.go | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'api') diff --git a/api/command.go b/api/command.go index bebe6629c..451de2c33 100644 --- a/api/command.go +++ b/api/command.go @@ -111,7 +111,7 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) { if provider != nil { response := provider.DoCommand(c, channelId, message) - handleResponse(c, w, response, channelId, provider.GetCommand(c)) + handleResponse(c, w, response, channelId, provider.GetCommand(c), true) return } else { chanChan := Srv.Store.Channel().Get(channelId) @@ -193,7 +193,7 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) { if response == nil { c.Err = model.NewLocAppError("command", "api.command.execute_command.failed_empty.app_error", map[string]interface{}{"Trigger": trigger}, "") } else { - handleResponse(c, w, response, channelId, cmd) + handleResponse(c, w, response, channelId, cmd, false) } } else { body, _ := ioutil.ReadAll(resp.Body) @@ -211,11 +211,14 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) { c.Err = model.NewLocAppError("command", "api.command.execute_command.not_found.app_error", map[string]interface{}{"Trigger": trigger}, "") } -func handleResponse(c *Context, w http.ResponseWriter, response *model.CommandResponse, channelId string, cmd *model.Command) { +func handleResponse(c *Context, w http.ResponseWriter, response *model.CommandResponse, channelId string, cmd *model.Command, builtIn bool) { post := &model.Post{} post.ChannelId = channelId - post.AddProp("from_webhook", "true") + + if !builtIn { + post.AddProp("from_webhook", "true") + } if utils.Cfg.ServiceSettings.EnablePostUsernameOverride { if len(cmd.Username) != 0 { diff --git a/api/file.go b/api/file.go index 5c983ea55..0011afd5b 100644 --- a/api/file.go +++ b/api/file.go @@ -52,7 +52,7 @@ const ( RotatedCCWMirrored = 7 RotatedCW = 8 - MaxImageSize = 4096 * 2160 // 4k resolution + MaxImageSize = 6048 * 4032 // 24 megapixels, roughly 36MB as a raw image ) var fileInfoCache *utils.Cache = utils.NewLru(1000) diff --git a/api/post.go b/api/post.go index 9d3ba5ab1..e6560a8e8 100644 --- a/api/post.go +++ b/api/post.go @@ -604,12 +604,12 @@ func sendNotifications(c *Context, post *model.Post, team *model.Team, channel * year := fmt.Sprintf("%d", tm.Year()) zone, _ := tm.Zone() - subjectPage := NewServerTemplatePage("post_subject", c.Locale) + subjectPage := NewServerTemplatePage("post_subject", profileMap[id].Locale) subjectPage.Props["Subject"] = userLocale("api.templates.post_subject", map[string]interface{}{"SubjectText": subjectText, "TeamDisplayName": team.DisplayName, "Month": month[:3], "Day": day, "Year": year}) - bodyPage := NewServerTemplatePage("post_body", c.Locale) + bodyPage := NewServerTemplatePage("post_body", profileMap[id].Locale) bodyPage.Props["SiteURL"] = c.GetSiteURL() bodyPage.Props["PostMessage"] = model.ClearMentionTags(post.Message) bodyPage.Props["TeamLink"] = teamURL + "/channels/" + channel.Name -- cgit v1.2.3-1-g7c22