Commit dcce30a4 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

JID: Add option to coerce to bare jid while parsing

parent daf9c92c
......@@ -595,7 +595,7 @@ class JID:
def from_string(cls, jid_string: str) -> JID:
def from_string(cls, jid_string: str, force_bare: bool = False) -> JID:
# Remove any portion from the first '/' character to the end of the
......@@ -614,6 +614,11 @@ class JID:
localpart, domainpart = None, rest
if force_bare:
if localpart is None:
raise LocalpartByteLimit
resourcepart = None
return cls(localpart=localpart,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment