message: add mechanism to exclude some types of message from conversations
  adjust ingest middleware tratement of findConversation and updating outdated response channels
diff: @@ -9,6 +9,8 @@ function SocketBot(configuration) {
  var controller = Botkit(configuration || {});
  + controller.excludeFromConversations = ['hello','welcome_back','reconnect'];
  +
  controller.openSocketServer = function(server) {
  // create the socket server along side the existing webserver.
  @@ -36,7 +38,7 @@ function SocketBot(configuration) {
  });
  ws.on('close', function(err) {
  - console.log('CLOSED', err);
  + // console.log('CLOSED', err);
  bot.connected = false;
  });
  @@ -64,13 +66,20 @@ function SocketBot(configuration) {
  bot.http_response = reply_channel;
  }
  - bot.findConversation(message, function(convo) {
  + // look for an existing conversation for this user/channel combo
  + // why not just pass in message? because we only care if there is a conversation ongoing
  + // and we might be dealing with "silent" message that would not otherwise match a conversation
  + bot.findConversation({
  + user: message.user,
  + channel: message.channel
  + }, function(convo) {
  if (convo) {
  if (bot.ws) {
  - if (!convo.task.bot.connected) {
  + // replace the websocket connection
  convo.task.bot.ws = bot.ws;
  convo.task.bot.connected = true;
  - controller.trigger('reconnect', [bot, message]);
  + if (message.type == 'hello' || message.type == 'welcome_back') {
  + message.type = 'reconnect';
  }
  } else {
  @@ -139,7 +148,7 @@ function SocketBot(configuration) {
  } else {
  - console.log('not connected. wait to resend');
  + // console.log('not connected. wait to resend');
  setTimeout(function() {
  bot.send(message, cb);
  }, 3000);
  @@ -226,7 +235,8 @@ function SocketBot(configuration) {
  for (var c = 0; c < botkit.tasks[t].convos.length; c++) {
  if (
  botkit.tasks[t].convos[c].isActive() &&
  - botkit.tasks[t].convos[c].source_message.user == message.user
  + botkit.tasks[t].convos[c].source_message.user == message.user &&
  + controller.excludeFromConversations.indexOf(message.type) == -1 // this type of message should not be included
  ) {
  botkit.debug('FOUND EXISTING CONVO!');
  cb(botkit.tasks[t].convos[c]);
  