util/jid.lua
changeset 12772 6e3aa3995eab
parent 12609 053417068957
child 12773 27e1d4354274
--- a/util/jid.lua	Tue Oct 11 13:31:47 2022 +0100
+++ b/util/jid.lua	Tue Oct 11 13:33:19 2022 +0100
@@ -35,8 +35,7 @@
 	if jid == nil then return; end
 	local node, nodepos = match(jid, "^([^@/]+)@()");
 	local host, hostpos = match(jid, "^([^@/]+)()", nodepos);
-	if node ~= nil and host == nil then return nil, nil, nil; end
-	local resource = match(jid, "^/(.+)$", hostpos);
+	local resource = host and match(jid, "^/(.+)$", hostpos);
 	if (host == nil) or ((resource == nil) and #jid >= hostpos) then return nil, nil, nil; end
 	return node, host, resource;
 end