Implement Room V10
This commit is contained in:
@@ -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])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user