Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

(Webex) Remove files key with empty string value #1906

Merged
merged 1 commit into from
Mar 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions packages/botbuilder-adapter-webex/src/webex_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ export class WebexAdapter extends BotAdapter {
event: 'all',
secret: this.options.secret,
name: webhook_name
}).then(function() {
}).then(function () {
debug('Webex: SUCCESSFULLY UPDATED WEBEX WEBHOOKS');
}).catch(function(err) {
}).catch(function (err) {
console.error('FAILED TO REGISTER WEBHOOK', err);
throw new Error(err);
});
Expand All @@ -290,14 +290,14 @@ export class WebexAdapter extends BotAdapter {
event: 'all',
secret: this.options.secret,
name: webhook_name
}).then(function() {
}).then(function () {
debug('Webex: SUCCESSFULLY REGISTERED WEBEX WEBHOOKS');
}).catch(function(err) {
}).catch(function (err) {
console.error('FAILED TO REGISTER WEBHOOK', err);
throw new Error(err);
});
}
}).catch(function(err) {
}).catch(function (err) {
throw new Error(err);
});
}
Expand Down Expand Up @@ -330,9 +330,9 @@ export class WebexAdapter extends BotAdapter {
event: 'all',
secret: this.options.secret,
name: webhook_name
}).then(function() {
}).then(function () {
debug('Webex: SUCCESSFULLY UPDATED WEBEX WEBHOOKS');
}).catch(function(err) {
}).catch(function (err) {
console.error('FAILED TO REGISTER WEBHOOK', err);
throw new Error(err);
});
Expand All @@ -343,14 +343,14 @@ export class WebexAdapter extends BotAdapter {
event: 'all',
secret: this.options.secret,
name: webhook_name
}).then(function() {
}).then(function () {
debug('Webex: SUCCESSFULLY REGISTERED WEBEX WEBHOOKS');
}).catch(function(err) {
}).catch(function (err) {
console.error('FAILED TO REGISTER WEBHOOK', err);
throw new Error(err);
});
}
}).catch(function(err) {
}).catch(function (err) {
throw new Error(err);
});
}
Expand All @@ -370,9 +370,10 @@ export class WebexAdapter extends BotAdapter {

// transform activity into the webex message format
// https://developer.webex.com/docs/api/v1/messages/create-a-message
const message: any = {
files: activity.channelData ? activity.channelData.files : ''
};
const message: any = {};
if (activity.channelData && activity.channelData.files) {
message.files = activity.channelData.files;
}
if (activity.text) {
message.text = activity.text;
}
Expand Down