@@ -583,7 +583,8 @@ async def set_power_levels(self, room_id: str, content: dict, **kwargs) -> dict:
583583
584584 async def get_pinned_messages (self , room_id : str ) -> List [str ]:
585585 await self .ensure_joined (room_id )
586- response = await self .client .request ("GET" , f"/rooms/{ room_id } /state/m.room.pinned_events" )
586+ response = await self .client .request ("GET" ,
587+ f"/rooms/{ quote (room_id )} /state/m.room.pinned_events" )
587588 return response ["content" ]["pinned" ]
588589
589590 def set_pinned_messages (self , room_id : str , events : List [str ], ** kwargs ) -> Awaitable [dict ]:
@@ -635,7 +636,7 @@ async def get_member_info(self, room_id: str, user_id: str, ignore_cache=False)
635636
636637 async def get_event (self , room_id : str , event_id : str ) -> dict :
637638 await self .ensure_joined (room_id )
638- return await self .client .request ("GET" , f"/rooms/{ room_id } /event/{ event_id } " )
639+ return await self .client .request ("GET" , f"/rooms/{ quote ( room_id ) } /event/{ quote ( event_id ) } " )
639640
640641 async def set_typing (self , room_id : str , is_typing : bool = True , timeout : int = 5000 ,
641642 ignore_cache : bool = False ) -> Optional [dict ]:
@@ -647,14 +648,15 @@ async def set_typing(self, room_id: str, is_typing: bool = True, timeout: int =
647648 }
648649 if is_typing :
649650 content ["timeout" ] = timeout
650- resp = await self .client .request ("PUT" , f"/rooms/{ room_id } /typing/{ self .mxid } " , content )
651+ resp = await self .client .request ("PUT" ,
652+ f"/rooms/{ quote (room_id )} /typing/{ self .mxid } " , content )
651653 self .state_store .set_typing (room_id , self .mxid , is_typing , timeout )
652654 return resp
653655
654656 async def mark_read (self , room_id : str , event_id : str ) -> dict :
655657 await self .ensure_joined (room_id )
656- return await self .client .request ("POST" , f"/rooms/ { room_id } /receipt/m.read/ { event_id } " ,
657- content = {})
658+ return await self .client .request (
659+ "POST" , f"/rooms/ { quote ( room_id ) } /receipt/m.read/ { quote ( event_id ) } " , content = {})
658660
659661 def send_notice (self , room_id : str , text : str , html : Optional [str ] = None ,
660662 relates_to : Optional [dict ] = None , ** kwargs ) -> Awaitable [dict ]:
0 commit comments