mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 01:05:53 -04:00
4965b61f2d
This still doesn't allow editing, but it supports showing the widgets at least.
29 lines
848 B
TypeScript
29 lines
848 B
TypeScript
import { Integration } from "./Integration";
|
|
import WidgetRecord from "../db/models/WidgetRecord";
|
|
|
|
export interface EtherpadWidgetOptions {
|
|
defaultUrl: string;
|
|
}
|
|
|
|
export interface JitsiWidgetOptions {
|
|
jitsiDomain: string;
|
|
scriptUrl: string;
|
|
}
|
|
|
|
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",
|
|
argument: [{isState: true, type: "im.vector.widget"}],
|
|
expectedValue: true,
|
|
}];
|
|
|
|
// Technically widgets are supported in encrypted rooms, although at risk.
|
|
this.isEncryptionSupported = true;
|
|
}
|
|
} |