2017-12-18 23:44:01 -05:00
|
|
|
import { Integration } from "./Integration";
|
|
|
|
import WidgetRecord from "../db/models/WidgetRecord";
|
|
|
|
|
|
|
|
export interface EtherpadWidgetOptions {
|
|
|
|
defaultUrl: string;
|
|
|
|
}
|
|
|
|
|
2017-12-20 23:28:43 -05:00
|
|
|
export interface JitsiWidgetOptions {
|
|
|
|
jitsiDomain: string;
|
|
|
|
scriptUrl: string;
|
|
|
|
}
|
|
|
|
|
2017-12-18 23:44:01 -05:00
|
|
|
export class Widget extends Integration {
|
|
|
|
public options: any;
|
|
|
|
|
|
|
|
constructor(widgetRecord: WidgetRecord) {
|
|
|
|
super(widgetRecord);
|
|
|
|
this.category = "widget";
|
|
|
|
this.options = widgetRecord.optionsJson ? JSON.parse(widgetRecord.optionsJson) : {};
|
|
|
|
this.requirements = [{
|
|
|
|
condition: "canSendEventTypes",
|
2017-12-20 23:28:43 -05:00
|
|
|
argument: [{isState: true, type: "im.vector.widget"}],
|
2017-12-18 23:44:01 -05:00
|
|
|
expectedValue: true,
|
|
|
|
}];
|
2017-12-20 23:28:43 -05:00
|
|
|
|
|
|
|
// Technically widgets are supported in encrypted rooms, although at risk.
|
|
|
|
this.isEncryptionSupported = true;
|
2017-12-18 23:44:01 -05:00
|
|
|
}
|
|
|
|
}
|