diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2017-01-27 15:58:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-27 15:58:50 -0500 |
commit | 65b76c2712eea4daa1633e4652fa3cd51037e854 (patch) | |
tree | 66306b5bd44ae7a4df4a7121fe85b9887cff160e /app/slackimport.go | |
parent | 097289f8e473c799ee752aa56e08f605110f5217 (diff) | |
download | chat-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 'app/slackimport.go')
-rw-r--r-- | app/slackimport.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/slackimport.go b/app/slackimport.go index 3289f140e..e4beb3d3d 100644 --- a/app/slackimport.go +++ b/app/slackimport.go @@ -307,12 +307,23 @@ func SlackAddPosts(teamId string, channel *model.Channel, posts []SlackPost, use l4g.Debug(utils.T("api.slackimport.slack_add_posts.user_no_exists.debug"), sPost.User) continue } + + var postType string + if sPost.SubType == "channel_join" { + postType = model.POST_JOIN_CHANNEL + } else { + postType = model.POST_LEAVE_CHANNEL + } + newPost := model.Post{ UserId: users[sPost.User].Id, ChannelId: channel.Id, Message: sPost.Text, CreateAt: SlackConvertTimeStamp(sPost.TimeStamp), - Type: model.POST_JOIN_LEAVE, + Type: postType, + Props: model.StringInterface{ + "username": users[sPost.User].Username, + }, } ImportPost(&newPost) case sPost.Type == "message" && sPost.SubType == "me_message": |