From 7d6d9c297f21fa8cf0848c071bcdd13691fb3d9b Mon Sep 17 00:00:00 2001 From: nickago Date: Fri, 10 Jul 2015 09:56:41 -0700 Subject: Added User update function --- api/user.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'api') diff --git a/api/user.go b/api/user.go index 483ae67b5..bdd26e097 100644 --- a/api/user.go +++ b/api/user.go @@ -135,6 +135,8 @@ func createUser(c *Context, w http.ResponseWriter, r *http.Request) { user.EmailVerified = true } + user.EmailVerified = true + ruser := CreateUser(c, team, user) if c.Err != nil { return @@ -729,6 +731,8 @@ func uploadProfileImage(c *Context, w http.ResponseWriter, r *http.Request) { return } + Srv.Store.User().UpdateUpdateAt(c.Session.UserId) + c.LogAudit("") } -- cgit v1.2.3-1-g7c22 From aff43f43f8185ae6d5555ca9f99bfcc4bd3eb99e Mon Sep 17 00:00:00 2001 From: nickago Date: Mon, 13 Jul 2015 09:27:30 -0700 Subject: removed testing state --- api/user.go | 2 -- 1 file changed, 2 deletions(-) (limited to 'api') diff --git a/api/user.go b/api/user.go index bdd26e097..5b052e826 100644 --- a/api/user.go +++ b/api/user.go @@ -135,8 +135,6 @@ func createUser(c *Context, w http.ResponseWriter, r *http.Request) { user.EmailVerified = true } - user.EmailVerified = true - ruser := CreateUser(c, team, user) if c.Err != nil { return -- cgit v1.2.3-1-g7c22 From f406beca8b501dad508d1ffb900bf994c4192086 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Fri, 10 Jul 2015 18:41:42 -0700 Subject: If a message has no text but has an attached image or file the desktop notification now says uploaded an image or uploaded a file respectively (if both, defaults to image) --- api/post.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'api') diff --git a/api/post.go b/api/post.go index 650f47062..02f997166 100644 --- a/api/post.go +++ b/api/post.go @@ -14,6 +14,7 @@ import ( "strconv" "strings" "time" + "path/filepath" ) func InitPost(r *mux.Router) { @@ -437,6 +438,19 @@ func fireAndForgetNotifications(post *model.Post, teamId, teamUrl string) { message := model.NewMessage(teamId, post.ChannelId, post.UserId, model.ACTION_POSTED) message.Add("post", post.ToJson()) + + if len(post.Filenames) != 0 { + message.Add("otherFile", "true") + + for _, filename := range post.Filenames { + ext := filepath.Ext(filename) + if model.IsFileExtImage(ext) { + message.Add("image", "true") + break + } + } + } + if len(mentionedUsers) != 0 { message.Add("mentions", model.ArrayToJson(mentionedUsers)) } -- cgit v1.2.3-1-g7c22 From 7ff57181b9aa182a7073a923004d63bbbe100e1d Mon Sep 17 00:00:00 2001 From: hmhealey Date: Tue, 14 Jul 2015 11:48:53 -0400 Subject: Changed image resizing for both the preview and thumbnail to use Lanczos interpolation instead of simple nearest neighbour --- api/file.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'api') diff --git a/api/file.go b/api/file.go index 0e08567d6..eaba515a4 100644 --- a/api/file.go +++ b/api/file.go @@ -13,9 +13,9 @@ import ( "github.com/mattermost/platform/model" "github.com/mattermost/platform/utils" "github.com/nfnt/resize" + _ "golang.org/x/image/bmp" "image" _ "image/gif" - _ "golang.org/x/image/bmp" "image/jpeg" "io" "net/http" @@ -157,7 +157,7 @@ func fireAndForgetHandleImages(filenames []string, fileData [][]byte, teamId, ch go func() { var thumbnail image.Image if imgConfig.Width > int(utils.Cfg.ImageSettings.ThumbnailWidth) { - thumbnail = resize.Resize(utils.Cfg.ImageSettings.ThumbnailWidth, utils.Cfg.ImageSettings.ThumbnailHeight, img, resize.NearestNeighbor) + thumbnail = resize.Resize(utils.Cfg.ImageSettings.ThumbnailWidth, utils.Cfg.ImageSettings.ThumbnailHeight, img, resize.Lanczos3) } else { thumbnail = img } @@ -182,7 +182,7 @@ func fireAndForgetHandleImages(filenames []string, fileData [][]byte, teamId, ch go func() { var preview image.Image if imgConfig.Width > int(utils.Cfg.ImageSettings.PreviewWidth) { - preview = resize.Resize(utils.Cfg.ImageSettings.PreviewWidth, utils.Cfg.ImageSettings.PreviewHeight, img, resize.NearestNeighbor) + preview = resize.Resize(utils.Cfg.ImageSettings.PreviewWidth, utils.Cfg.ImageSettings.PreviewHeight, img, resize.Lanczos3) } else { preview = img } -- cgit v1.2.3-1-g7c22