diff --git a/CLAUDE.md b/CLAUDE.md index 9370c09..ed82000 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -109,10 +109,14 @@ for the React-side bridge code. - **`SessionDataManager.getUserData(id)` does NOT exist.** Some legacy code in the React client used it under a `getUserData ?` truthy guard; the branch was always dead. Only `getUserDataSnapshot()` exists. -- `IRoomSession.sendChatMessage` / `sendShoutMessage` require **3 args** - (text, styleId, chatColour). The React client's chat-input legacy - passes 2 — known pre-existing gap, do not "fix" the client without - also threading chatColour through the chat composer pipeline. +- `IRoomSession.sendChatMessage` / `sendShoutMessage` accept an optional + `chatColour` 3rd arg (was required pre-2.1.1, now optional to match + the historical call sites in the React client). The implementation + forwards `undefined` to the composer just fine; pass a value only when + you need a specific bubble colour. +- `IRoomSession.password` and `IRoomSession.sendBackgroundMessage` are + now part of the public interface (they always existed on the + implementation class — interface caught up). - The renderer is **synchronous**: `EventDispatcher.dispatchEvent` is a synchronous loop over listeners. Don't add `await` inside the `processEvent` loop — it would change ordering guarantees that diff --git a/packages/api/src/nitro/session/IRoomSession.ts b/packages/api/src/nitro/session/IRoomSession.ts index 02a905e..d12ad5a 100644 --- a/packages/api/src/nitro/session/IRoomSession.ts +++ b/packages/api/src/nitro/session/IRoomSession.ts @@ -9,10 +9,11 @@ export interface IRoomSession setRoomOwner(): void; start(): boolean; reset(roomId: number): void; - sendChatMessage(text: string, styleId: number, chatColour: string): void; - sendShoutMessage(text: string, styleId: number, chatColour: string): void; + sendChatMessage(text: string, styleId: number, chatColour?: string): void; + sendShoutMessage(text: string, styleId: number, chatColour?: string): void; sendWhisperMessage(recipientName: string, text: string, styleId: number): void; sendChatTypingMessage(isTyping: boolean): void; + sendBackgroundMessage(backgroundImage: number, backgroundStand: number, backgroundOverlay: number, backgroundCard?: number): void; sendMottoMessage(motto: string): void; sendDanceMessage(danceId: number): void; sendExpressionMessage(expression: number): void; @@ -50,6 +51,7 @@ export interface IRoomSession sendScriptProceed(): void; userDataManager: IUserDataManager; roomId: number; + password: string; state: string; tradeMode: number; isPrivateRoom: boolean;