JID: Make node and resource setters accept None

This is the proper way to unset these.
This commit is contained in:
Emmanuel Gil Peyrot 2022-08-21 14:18:53 +02:00
parent 1f47acaec1
commit 1caada197a

View file

@ -368,7 +368,7 @@ class JID:
return self._node return self._node
@node.setter @node.setter
def node(self, value: str): def node(self, value: Optional[str]):
self._node = _validate_node(value) self._node = _validate_node(value)
self._update_bare_full() self._update_bare_full()
@ -386,7 +386,7 @@ class JID:
return self._resource return self._resource
@resource.setter @resource.setter
def resource(self, value: str): def resource(self, value: Optional[str]):
self._resource = _validate_resource(value) self._resource = _validate_resource(value)
self._update_bare_full() self._update_bare_full()