fix comments
parent
1fe7be0be1
commit
7c224e149b
|
@ -331,6 +331,14 @@ class UserID(DomainSpecificString):
|
||||||
SIGIL = "@"
|
SIGIL = "@"
|
||||||
|
|
||||||
def validate(self, allow_historical_mxids: Optional[bool] = False) -> bool:
|
def validate(self, allow_historical_mxids: Optional[bool] = False) -> bool:
|
||||||
|
"""Validate an user ID against the spec.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
allow_historical_mxids: True to allow historical mxids, which can
|
||||||
|
include all printable ASCII chars minus `:`
|
||||||
|
Returns:
|
||||||
|
True if the user ID is invalid per the spec
|
||||||
|
"""
|
||||||
is_valid = True
|
is_valid = True
|
||||||
if len(self.to_string().encode("utf-8")) > 255:
|
if len(self.to_string().encode("utf-8")) > 255:
|
||||||
logger.warn(
|
logger.warn(
|
||||||
|
@ -383,9 +391,8 @@ def contains_invalid_mxid_characters(
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
localpart: the localpart to be checked
|
localpart: the localpart to be checked
|
||||||
allow_legacy_mxids: True to use the extended allowed characters
|
allow_historical_mxids: True to allow historical mxids, which can
|
||||||
from MSC4009.
|
include all printable ASCII chars minus `:`
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
True if there are any naughty characters
|
True if there are any naughty characters
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue