summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-01-27 15:58:50 -0500
committerGitHub <noreply@github.com>2017-01-27 15:58:50 -0500
commit65b76c2712eea4daa1633e4652fa3cd51037e854 (patch)
tree66306b5bd44ae7a4df4a7121fe85b9887cff160e /api
parent097289f8e473c799ee752aa56e08f605110f5217 (diff)
downloadchat-65b76c2712eea4daa1633e4652fa3cd51037e854.tar.gz
chat-65b76c2712eea4daa1633e4652fa3cd51037e854.tar.bz2
chat-65b76c2712eea4daa1633e4652fa3cd51037e854.zip
PLT-5225 Added separate post types for certain system messages (#5193)
* Added separate post types for system_join_leave and system_add_remove posts * Added username prop to channel deleted posts * Changed slack import to properly generate the new join/leave messages * Added username prop to channel update posts * Moved Post(AddTo/RemoveFrom)ChanneMessage into app package
Diffstat (limited to 'api')
-rw-r--r--api/channel.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/api/channel.go b/api/channel.go
index 474c41d07..c5ec36d4b 100644
--- a/api/channel.go
+++ b/api/channel.go
@@ -4,7 +4,6 @@
package api
import (
- "fmt"
"net/http"
"strconv"
"strings"
@@ -644,7 +643,7 @@ func addMember(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- go app.PostUserAddRemoveMessage(c.Session.UserId, channel.Id, channel.TeamId, fmt.Sprintf(utils.T("api.channel.add_member.added"), nUser.Username, oUser.Username), model.POST_ADD_REMOVE)
+ go app.PostAddToChannelMessage(oUser, nUser, channel)
app.UpdateChannelLastViewedAt([]string{id}, oUser.Id)
w.Write([]byte(cm.ToJson()))
@@ -697,7 +696,7 @@ func removeMember(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- go app.PostUserAddRemoveMessage(c.Session.UserId, channel.Id, channel.TeamId, fmt.Sprintf(utils.T("api.channel.remove_member.removed"), user.Username), model.POST_ADD_REMOVE)
+ go app.PostRemoveFromChannelMessage(c.Session.UserId, user, channel)
result := make(map[string]string)
result["channel_id"] = channel.Id