Implement rooms V3 through V9

This commit is contained in:
2025-10-25 04:22:48 -04:00
parent 2f891508ab
commit 9b6988a029
7 changed files with 126 additions and 11 deletions

View File

@@ -10,7 +10,7 @@ import httpx
import json
import re
version = "1.4.4"
version = "1.5.0"
def canonical_json(value):
@@ -261,10 +261,14 @@ def make_ref_hash(
def room_version_from_id(room):
room_id_no_sigil = room.replace("!", "")
room_id_no_sigil = (
room
.replace("!", "")
.replace(f":{config.server_name}", "")
)
hexadecimal_room_id = bytes(room_id_no_sigil, "utf-8").hex()
versions = [str(i) for i in range(1, 3)]
versions = [str(i) for i in range(1, 10)]
if not any(ver in hexadecimal_room_id for ver in versions):
hexadecimal_room_id = "2" + hexadecimal_room_id[1:]