diff libervia/web/pages/_browser/jid.py @ 1572:7006b55001a4

broweser (jid): add a simple check for JID validation.
author Goffi <goffi@goffi.org>
date Wed, 22 Nov 2023 16:31:36 +0100
parents b338c31d5251
children
line wrap: on
line diff
--- a/libervia/web/pages/_browser/jid.py	Wed Nov 22 16:31:36 2023 +0100
+++ b/libervia/web/pages/_browser/jid.py	Wed Nov 22 16:31:36 2023 +0100
@@ -89,7 +89,12 @@
         @return: True if the JID is XMPP compliant
         """
         # Simple check for domain part
-        if not self.domain or self.domain.startswith(".") or self.domain.endswith("."):
+        if (
+            not self.domain
+            or self.domain.startswith(".")
+            or self.domain.endswith(".")
+            or "." not in self.domain
+        ):
             return False
         if ".." in self.domain:
             return False