diff options
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": |