Merge pull request #861 from vector-im/dbkr/dont_lowercase_room_ids
Fix joining rooms by ID
This commit is contained in:
		
				commit
				
					
						0bb18be4ef
					
				
			
		
					 1 changed files with 10 additions and 4 deletions
				
			
		| 
						 | 
					@ -53,15 +53,21 @@ export const useLoadGroupCall = (
 | 
				
			||||||
    const fetchOrCreateRoom = async (): Promise<Room> => {
 | 
					    const fetchOrCreateRoom = async (): Promise<Room> => {
 | 
				
			||||||
      try {
 | 
					      try {
 | 
				
			||||||
        // We lowercase the localpart when we create the room, so we must lowercase
 | 
					        // We lowercase the localpart when we create the room, so we must lowercase
 | 
				
			||||||
        // it here too (we just do the whole alias).
 | 
					        // it here too (we just do the whole alias). We can't do the same to room IDs
 | 
				
			||||||
        const room = await client.joinRoom(roomIdOrAlias.toLowerCase(), {
 | 
					        // though.
 | 
				
			||||||
 | 
					        const sanitisedIdOrAlias =
 | 
				
			||||||
 | 
					          roomIdOrAlias[0] === "#"
 | 
				
			||||||
 | 
					            ? roomIdOrAlias.toLowerCase()
 | 
				
			||||||
 | 
					            : roomIdOrAlias;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        const room = await client.joinRoom(sanitisedIdOrAlias, {
 | 
				
			||||||
          viaServers,
 | 
					          viaServers,
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        logger.info(
 | 
					        logger.info(
 | 
				
			||||||
          `Joined ${roomIdOrAlias}, waiting room to be ready for group calls`
 | 
					          `Joined ${sanitisedIdOrAlias}, waiting room to be ready for group calls`
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
        await client.waitUntilRoomReadyForGroupCalls(room.roomId);
 | 
					        await client.waitUntilRoomReadyForGroupCalls(room.roomId);
 | 
				
			||||||
        logger.info(`${roomIdOrAlias}, is ready for group calls`);
 | 
					        logger.info(`${sanitisedIdOrAlias}, is ready for group calls`);
 | 
				
			||||||
        return room;
 | 
					        return room;
 | 
				
			||||||
      } catch (error) {
 | 
					      } catch (error) {
 | 
				
			||||||
        if (
 | 
					        if (
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue