Merge branch 'develop' into travis/moar-jitsi

This commit is contained in:
Travis Ralston 2020-04-14 12:57:28 -06:00 committed by GitHub
commit 4fe16b1b84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 386 additions and 407 deletions

View file

@ -68,6 +68,7 @@ export default class WidgetUtils {
return false;
}
// TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111)
return room.currentState.maySendStateEvent('im.vector.modular.widgets', me);
}
@ -182,6 +183,7 @@ export default class WidgetUtils {
}
const room = MatrixClientPeg.get().getRoom(roomId);
// TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111)
const startingWidgetEvents = room.currentState.getStateEvents('im.vector.modular.widgets');
if (eventsInIntendedState(startingWidgetEvents)) {
resolve();
@ -191,6 +193,7 @@ export default class WidgetUtils {
function onRoomStateEvents(ev) {
if (ev.getRoomId() !== roomId) return;
// TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111)
const currentWidgetEvents = room.currentState.getStateEvents('im.vector.modular.widgets');
if (eventsInIntendedState(currentWidgetEvents)) {
@ -272,8 +275,7 @@ export default class WidgetUtils {
WidgetEchoStore.setRoomWidgetEcho(roomId, widgetId, content);
const client = MatrixClientPeg.get();
// TODO - Room widgets need to be moved to 'm.widget' state events
// https://docs.google.com/document/d/1uPF7XWY_dXTKVKV7jZQ2KmsI19wn9-kFRgQ1tFQP7wQ/edit?usp=sharing
// TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111)
return client.sendStateEvent(roomId, "im.vector.modular.widgets", content, widgetId).then(() => {
return WidgetUtils.waitForRoomWidget(widgetId, roomId, addingWidget);
}).finally(() => {
@ -287,6 +289,7 @@ export default class WidgetUtils {
* @return {[object]} Array containing current / active room widgets
*/
static getRoomWidgets(room: Room) {
// TODO: Enable support for m.widget event type (https://github.com/vector-im/riot-web/issues/13111)
const appsStateEvents = room.currentState.getStateEvents('im.vector.modular.widgets');
if (!appsStateEvents) {
return [];