mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-01 10:27:06 +03:00
Open integration manager from widget postMessage.
This commit is contained in:
parent
d3de44e6eb
commit
14d52c9f25
1 changed files with 6 additions and 0 deletions
|
@ -22,6 +22,7 @@ limitations under the License.
|
||||||
import URL from 'url';
|
import URL from 'url';
|
||||||
import dis from './dispatcher';
|
import dis from './dispatcher';
|
||||||
import MatrixPostMessageApi from './MatrixPostMessageApi';
|
import MatrixPostMessageApi from './MatrixPostMessageApi';
|
||||||
|
import IntegrationManager from './IntegrationManager';
|
||||||
|
|
||||||
const WIDGET_API_VERSION = '0.0.1'; // Current API version
|
const WIDGET_API_VERSION = '0.0.1'; // Current API version
|
||||||
const SUPPORTED_WIDGET_API_VERSIONS = [
|
const SUPPORTED_WIDGET_API_VERSIONS = [
|
||||||
|
@ -196,6 +197,11 @@ export default class WidgetMessaging extends MatrixPostMessageApi {
|
||||||
});
|
});
|
||||||
} else if (action === 'sticker_message') {
|
} else if (action === 'sticker_message') {
|
||||||
dis.dispatch({action: 'sticker_message', data: event.data.widgetData, widgetId: event.data.widgetId});
|
dis.dispatch({action: 'sticker_message', data: event.data.widgetData, widgetId: event.data.widgetId});
|
||||||
|
} else if (action === 'integration_manager_open') {
|
||||||
|
const data = event.data.widgetData;
|
||||||
|
const integType = (data && data.integType) ? data.integType : null;
|
||||||
|
const integId = (data && data.integId) ? data.integId : null;
|
||||||
|
IntegrationManager.open(integType, integId);
|
||||||
} else {
|
} else {
|
||||||
console.warn("Widget postMessage event unhandled");
|
console.warn("Widget postMessage event unhandled");
|
||||||
this.sendError(event, {message: "The postMessage was unhandled"});
|
this.sendError(event, {message: "The postMessage was unhandled"});
|
||||||
|
|
Loading…
Reference in a new issue