Implement Room V10

This commit is contained in:
2025-10-26 06:36:15 -04:00
parent 9d68082764
commit 1c87e8b5a5
4 changed files with 17 additions and 9 deletions

View File

@@ -268,7 +268,7 @@ def room_version_from_id(room):
)
hexadecimal_room_id = bytes(room_id_no_sigil, "utf-8").hex()
versions = [str(i) for i in range(1, 10)]
versions = [str(i) for i in range(0, 10)]
if not any(ver in hexadecimal_room_id for ver in versions):
hexadecimal_room_id = "2" + hexadecimal_room_id[1:]
@@ -282,7 +282,11 @@ def room_version_from_id(room):
s = s.replace(" ", "").lower()
counts = Counter(s)
most_common = counts.most_common(1)
return most_common[0] if most_common else ("2",)
actual_most_common = most_common[0] if most_common else ("4",)
if actual_most_common[0] == "0":
return ("10",)
return actual_most_common
return str(most_common_character(nums)[0])