Implement Left Panel User Widget

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-09-24 09:28:49 +01:00
parent f699be971e
commit 956a3bf69d
6 changed files with 315 additions and 3 deletions

View file

@ -42,7 +42,7 @@ export interface IWidget {
type: string;
sender: string;
state_key: string;
content: IApp;
content: Partial<IApp>;
}
export default class WidgetUtils {
@ -410,7 +410,7 @@ export default class WidgetUtils {
return client.setAccountData('m.widgets', userWidgets);
}
static makeAppConfig(appId: string, app: IApp, senderUserId: string, roomId: string | null, eventId: string): IApp {
static makeAppConfig(appId: string, app: Partial<IApp>, senderUserId: string, roomId: string | null, eventId: string): IApp {
if (!senderUserId) {
throw new Error("Widgets must be created by someone - provide a senderUserId");
}
@ -421,7 +421,7 @@ export default class WidgetUtils {
app.eventId = eventId;
app.name = app.name || app.type;
return app;
return app as IApp;
}
static getCapWhitelistForAppTypeInRoomId(appType: string, roomId: string): Capability[] {