Fix Slack Importer incorrectly logging missed types and add slackbot_response to the import

pull/5724/head
Bradley Hilton 9 years ago
parent 97c81d10c5
commit f4de7ac63f
No known key found for this signature in database
GPG Key ID: 0666B2C24C43C358
  1. 7
      packages/rocketchat-importer-slack/server.coffee

@ -229,7 +229,7 @@ Importer.Slack = class Importer.Slack extends Importer.Base
msg: "_#{@convertSlackMessageToRocketChat(message.text)}_"
_.extend msgObj, msgDataDefaults
RocketChat.sendMessage @getRocketUser(message.user), msgObj, room, true
else if message.subtype is 'bot_message'
else if message.subtype is 'bot_message' or message.subtype is 'slackbot_response'
botUser = RocketChat.models.Users.findOneById 'rocket.cat', { fields: { username: 1 }}
botUsername = if @bots[message.bot_id] then @bots[message.bot_id]?.name else message.username
msgObj =
@ -320,7 +320,10 @@ Importer.Slack = class Importer.Slack extends Importer.Base
Meteor.call 'setReaction', ":#{reaction.name}:", msgDataDefaults._id
@addCountCompleted 1
console.log 'Missed import types:', missedTypes
if not _.isEmpty missedTypes
console.log 'Missed import types:', missedTypes
@updateProgress Importer.ProgressStep.FINISHING
for channel in @channels.channels when channel.do_import and channel.is_archived
do (channel) =>

Loading…
Cancel
Save