Send messages on widget addition and deletion

pull/21833/head
Richard Lewis 2017-08-06 11:01:14 +01:00
parent 308d932b2f
commit 18ae5fd129
2 changed files with 9 additions and 1 deletions

View File

@ -338,6 +338,12 @@ function setWidget(event, roomId) {
sendResponse(event, { sendResponse(event, {
success: true, success: true,
}); });
if (widgetUrl !== null) {
client.sendTextMessage(roomId, `Added ${widgetType} widget - ${widgetUrl}`);
} else {
client.sendTextMessage(roomId, `Removed ${widgetType} widget`);
}
}, (err) => { }, (err) => {
sendError(event, _t('Failed to send request.'), err); sendError(event, _t('Failed to send request.'), err);
}); });

View File

@ -121,7 +121,9 @@ module.exports = React.createClass({
this.scalarClient.getScalarInterfaceUrlForRoom(this.props.room.roomId) : this.scalarClient.getScalarInterfaceUrlForRoom(this.props.room.roomId) :
null, null,
onFinished: ()=>{ onFinished: ()=>{
if (this.props.onCancelClick) {
this.props.onCancelClick(ev); this.props.onCancelClick(ev);
}
}, },
}, "mx_IntegrationsManager"); }, "mx_IntegrationsManager");
}, },