Fix alias resolve: keep # (URL-encoded) for directory lookup; v2.0.4
This commit is contained in:
parent
78820450e1
commit
1509b0925e
3 changed files with 4 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
maubot: 0.1.0
|
||||
id: nl.roomsoverview
|
||||
version: 2.0.3
|
||||
version: 2.0.4
|
||||
license: MIT
|
||||
modules:
|
||||
- roomsoverview
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -189,10 +189,11 @@ class RoomsOverviewPlugin(Plugin):
|
|||
|
||||
async def _resolve_alias(self, alias: str) -> Optional[str]:
|
||||
"""Los een #alias op naar een room_id."""
|
||||
a = alias.lstrip("#")
|
||||
# De homeserver verwacht de alias inclusief '#', URL-gecodeerd (%23…);
|
||||
# zonder '#' geeft Synapse "Room alias invalid" (M_INVALID_PARAM).
|
||||
try:
|
||||
async with self.http.get(
|
||||
f"{self._base_url()}/_matrix/client/v3/directory/room/{quote(a, safe='')}",
|
||||
f"{self._base_url()}/_matrix/client/v3/directory/room/{quote(alias, safe='')}",
|
||||
headers=self._headers(),
|
||||
timeout=_REQUEST_TIMEOUT,
|
||||
) as r:
|
||||
|
|
|
|||
Loading…
Reference in a new issue