minor tweak

This commit is contained in:
cottongin
2025-10-31 21:41:27 -04:00
parent c63c29efc9
commit 3116721256
7 changed files with 14 additions and 2000 deletions

View File

@@ -61,8 +61,8 @@ func (b *Bkosmi) Connect() error {
b.roomID = roomID
b.Log.Infof("Extracted room ID: %s", b.roomID)
// Create Native client (Playwright establishes WebSocket, we control it directly)
b.client = NewNativeClient(b.roomURL, b.roomID, b.Log)
// Create GraphQL WebSocket client (pure Go, no Playwright!)
b.client = NewGraphQLWSClient(b.roomURL, b.roomID, b.Log)
// Register message handler
b.client.OnMessage(b.handleIncomingMessage)
@@ -198,8 +198,11 @@ func extractRoomID(url string) (string, error) {
matches := re.FindStringSubmatch(url)
if len(matches) >= 2 {
roomID := matches[1]
// Remove @ prefix if present (Kosmi uses both formats)
return strings.TrimPrefix(roomID, "@"), nil
// Ensure @ prefix is present (required for WebSocket API)
if !strings.HasPrefix(roomID, "@") {
roomID = "@" + roomID
}
return roomID, nil
}
}