summaryrefslogtreecommitdiffstats
path: root/api/slackimport.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2016-11-28 15:39:06 +0000
committerHarrison Healey <harrisonmhealey@gmail.com>2016-11-28 10:39:06 -0500
commitbe0ae364223efb1c32a8a1815583663071f255c5 (patch)
treee1b87f4f75a11dbf0e9060b842047d0ba86a2f80 /api/slackimport.go
parent7315d69474b6fc8fd1d208224195a75455f1665e (diff)
downloadchat-be0ae364223efb1c32a8a1815583663071f255c5.tar.gz
chat-be0ae364223efb1c32a8a1815583663071f255c5.tar.bz2
chat-be0ae364223efb1c32a8a1815583663071f255c5.zip
Fix failure to import same Slack archive to 2 teams. (#4650)
This fixes the issue where you can't import 2 Slack exports with any users who's emails appear in both exports onto different teams of the same server. Fixes #4126
Diffstat (limited to 'api/slackimport.go')
-rw-r--r--api/slackimport.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/api/slackimport.go b/api/slackimport.go
index 90e92cf0a..15f5f43f4 100644
--- a/api/slackimport.go
+++ b/api/slackimport.go
@@ -162,7 +162,11 @@ func SlackAddUsers(teamId string, slackusers []SlackUser, log *bytes.Buffer) map
if result := <-Srv.Store.User().GetByEmail(email); result.Err == nil {
existingUser := result.Data.(*model.User)
addedUsers[sUser.Id] = existingUser
- log.WriteString(utils.T("api.slackimport.slack_add_users.merge_existing", map[string]interface{}{"Email": existingUser.Email, "Username": existingUser.Username}))
+ if err := JoinUserToTeam(team, addedUsers[sUser.Id]); err != nil {
+ log.WriteString(utils.T("api.slackimport.slack_add_users.merge_existing_failed", map[string]interface{}{"Email": existingUser.Email, "Username": existingUser.Username}))
+ } else {
+ log.WriteString(utils.T("api.slackimport.slack_add_users.merge_existing", map[string]interface{}{"Email": existingUser.Email, "Username": existingUser.Username}))
+ }
continue
}