mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
Fix Matrix chat invite error by exposing inviteToRoom in MatrixContext
- Add inviteToRoom to MatrixContextType interface - Create wrapper function for matrixService.inviteToRoom - Expose inviteToRoom in contextValue object - Fixes 'TypeError: inviteToRoom is not a function' error when inviting users to existing Matrix chats - Resolves issue in useSessionSharing.ts where inviteToRoom was undefined
This commit is contained in:
@@ -20,6 +20,7 @@ interface MatrixContextType {
|
||||
addFriend: (userId: string) => Promise<void>;
|
||||
createAISession: (name: string, inviteUserIds?: string[]) => Promise<string>;
|
||||
joinRoom: (roomId: string) => Promise<void>;
|
||||
inviteToRoom: (roomId: string, userId: string) => Promise<void>;
|
||||
sendMessage: (roomId: string, message: string) => Promise<void>;
|
||||
sendAIPrompt: (roomId: string, prompt: string, sessionId: string, model?: string) => Promise<void>;
|
||||
setAvatar: (file: File) => Promise<string>;
|
||||
@@ -204,6 +205,11 @@ export const MatrixProvider: React.FC<MatrixProviderProps> = ({ 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<MatrixProviderProps> = ({ children, matrix
|
||||
addFriend,
|
||||
createAISession,
|
||||
joinRoom,
|
||||
inviteToRoom,
|
||||
sendMessage,
|
||||
sendAIPrompt,
|
||||
setAvatar,
|
||||
|
||||
Reference in New Issue
Block a user