diff --git a/frontend/src/Widget.jsx b/frontend/src/Widget.jsx index 45ef910..4220eee 100644 --- a/frontend/src/Widget.jsx +++ b/frontend/src/Widget.jsx @@ -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 {