request capability on start
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 42s Details

This commit is contained in:
Ladd Hoffman 2024-04-25 21:57:51 -05:00
parent 83d43b8312
commit ab103d3038
1 changed files with 7 additions and 6 deletions

View File

@ -277,6 +277,13 @@ function Widget() {
});
widgetApi.current.start();
const sendMessageCapability = WidgetEventCapability.forRoomEvent(
EventDirection.Send,
'm.room.message',
);
widgetApi.current.requestCapability(sendMessageCapability.raw);
widgetApi.current.updateRequestedCapabilities();
}, []);
/* -------------------------------------------------------------------------------- */
@ -363,12 +370,6 @@ function Widget() {
// TODO: Sign and send a message to the forum-api bot / to a room in matrix
const registerMatrixIdentity = async () => {
const sendMessageCapability = WidgetEventCapability.forRoomEvent(
EventDirection.Send,
'm.room.message',
);
widgetApi.current.requestCapability(sendMessageCapability.raw);
await widgetApi.current.updateRequestedCapabilities();
if (widgetApi.current.hasCapability(sendMessageCapability)) {
await widgetApi.current.sendRoomEvent('m.message', 'test message', '!HMoNkuTRLqQGhhlMNO:matrix.dgov.io');
} else {