X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=util%2Fjid.lua;h=76155ac70f81d7118693ab6f8bfe8d7116196b20;hb=b6d336cbfe79bf837dbf89f80d4852aa58a110c4;hp=696f51d83ff5e2093f4f7b275ab1c1d70bb63e71;hpb=dcf4c0d6e836ae1bb9a4171ebb8ffd1437fed159;p=prosody.git diff --git a/util/jid.lua b/util/jid.lua index 696f51d8..76155ac7 100644 --- a/util/jid.lua +++ b/util/jid.lua @@ -36,7 +36,11 @@ local function split(jid) end local function bare(jid) - return jid and match(jid, "^[^/]+"); + local node, host = split(jid); + if node and host then + return node.."@"..host; + end + return host; end local function prepped_split(jid)