diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/post.go | 14 | ||||
-rw-r--r-- | api/team.go | 2 | ||||
-rw-r--r-- | api/user.go | 2 |
3 files changed, 16 insertions, 2 deletions
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)) } diff --git a/api/team.go b/api/team.go index c4a0ca181..f9aeecd7e 100644 --- a/api/team.go +++ b/api/team.go @@ -68,7 +68,7 @@ func signupTeam(c *Context, w http.ResponseWriter, r *http.Request) { return } - if utils.Cfg.ServiceSettings.Mode == utils.MODE_DEV { + if utils.Cfg.ServiceSettings.Mode == utils.MODE_DEV || utils.Cfg.EmailSettings.ByPassEmail { m["follow_link"] = bodyPage.Props["Link"] } diff --git a/api/user.go b/api/user.go index 5b052e826..0c63868b3 100644 --- a/api/user.go +++ b/api/user.go @@ -293,7 +293,7 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) { return } - if !user.EmailVerified { + if !user.EmailVerified && !utils.Cfg.EmailSettings.ByPassEmail { c.Err = model.NewAppError("login", "Login failed because email address has not been verified", extraInfo) c.Err.StatusCode = http.StatusForbidden return |