message: add format middleware for teams
diff: @@ -96,18 +96,9 @@ function TeamsBot(configuration) {
  bot.send = function(message, cb) {
  - var data = {
  - type: 'message',
  - recipient: message.recipient,
  - from: message.from,
  - text: message.text,
  - textFormat: 'markdown',
  - entities: message.entities,
  - attachments: message.attachments || null,
  - attachmentLayout: message.attachmentLayout || 'list',
  - };
  - bot.api.addMessageToConversation(message.conversation.id, data, cb);
  +
  + bot.api.addMessageToConversation(message.conversation.id, message, cb);
  };
  @@ -367,10 +358,17 @@ function TeamsBot(configuration) {
  controller.middleware.format.use(function(bot, message, platform_message, next) {
  - // clone the incoming message
  - for (var k in message) {
  - platform_message[k] = message[k];
  - }
  + platform_message = {
  + type: 'message',
  + recipient: message.recipient,
  + from: message.from,
  + text: message.text,
  + textFormat: 'markdown',
  + entities: message.entities,
  + attachments: message.attachments || null,
  + attachmentLayout: message.attachmentLayout || 'list',
  + conversation: message.conversation,
  + };
  next();
  });
  