diff --git a/ui/desktop/src/contexts/MatrixContext.tsx b/ui/desktop/src/contexts/MatrixContext.tsx index a86ba96e37..ce7f6039e9 100644 --- a/ui/desktop/src/contexts/MatrixContext.tsx +++ b/ui/desktop/src/contexts/MatrixContext.tsx @@ -20,6 +20,7 @@ interface MatrixContextType { addFriend: (userId: string) => Promise; createAISession: (name: string, inviteUserIds?: string[]) => Promise; joinRoom: (roomId: string) => Promise; + inviteToRoom: (roomId: string, userId: string) => Promise; sendMessage: (roomId: string, message: string) => Promise; sendAIPrompt: (roomId: string, prompt: string, sessionId: string, model?: string) => Promise; setAvatar: (file: File) => Promise; @@ -204,6 +205,11 @@ export const MatrixProvider: React.FC = ({ children, matrix // Data will be updated via the membershipChange event }; + const inviteToRoom = async (roomId: string, userId: string) => { + await matrixService.inviteToRoom(roomId, userId); + // Data will be updated via the membershipChange event + }; + const sendMessage = async (roomId: string, message: string) => { await matrixService.sendMessage(roomId, message); }; @@ -331,6 +337,7 @@ export const MatrixProvider: React.FC = ({ children, matrix addFriend, createAISession, joinRoom, + inviteToRoom, sendMessage, sendAIPrompt, setAvatar,