Skip to content

Commit

Permalink
Merge pull request geoffwhittington#37 from jeremiah-k/main
Browse files Browse the repository at this point in the history
Matrix alias support
  • Loading branch information
jeremiah-k authored May 7, 2023
2 parents 1ef744d + e58eab7 commit 9ff9905
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion matrix_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,19 @@ async def join_matrix_room(matrix_client, room_id_or_alias: str) -> None:
"""Join a Matrix room by its ID or alias."""
try:
if room_id_or_alias.startswith("#"):
response = await matrix_client.resolve_room_alias(room_id_or_alias)
response = await matrix_client.room_resolve_alias(room_id_or_alias)
if not response.room_id:
logger.error(
f"Failed to resolve room alias '{room_id_or_alias}': {response.message}"
)
return
room_id = response.room_id
# Update the room ID in the matrix_rooms list
for room_config in matrix_rooms:
if room_config["id"] == room_id_or_alias:
room_config["id"] = room_id
break

else:
room_id = room_id_or_alias

Expand Down

0 comments on commit 9ff9905

Please sign in to comment.