From c0ab2636d699c8544ce03a58f61b95cfd66ff7ce Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Mon, 18 Jul 2016 11:10:03 -0400 Subject: PLT-2241 Refactored statuses into a more real-time system (#3573) * Refactored statuses into a more real-time system * Updated package.json with correct commit and fixed minor bug * Minor updates to statuses based on feedback * When setting status online, update only LastActivityAt if status already exists --- api/post.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'api/post.go') diff --git a/api/post.go b/api/post.go index 60ac11a2b..4533823f6 100644 --- a/api/post.go +++ b/api/post.go @@ -597,7 +597,13 @@ func sendNotifications(c *Context, post *model.Post, team *model.Team, channel * for _, id := range mentionedUsersList { userAllowsEmails := profileMap[id].NotifyProps["email"] != "false" - if userAllowsEmails && (profileMap[id].IsAway() || profileMap[id].IsOffline()) { + var status *model.Status + var err *model.AppError + if status, err = GetStatus(id); err != nil { + status = &model.Status{id, model.STATUS_OFFLINE, 0} + } + + if userAllowsEmails && status.Status != model.STATUS_ONLINE { sendNotificationEmail(c, post, profileMap[id], channel, team, senderName) } } -- cgit v1.2.3-1-g7c22