# HG changeset patch # User Matthew Wild # Date 1222539460 -3600 # Node ID 859b316e2fb0cba8c35c0186e2b71224108956dd # Parent 23cab333d014a1992f5b1fb3d4ee85c2e81badc5 Fixing jid.split() for all JIDs diff -r 23cab333d014 -r 859b316e2fb0 util/jid.lua --- a/util/jid.lua Wed Sep 17 21:33:05 2008 +0100 +++ b/util/jid.lua Sat Sep 27 19:17:40 2008 +0100 @@ -4,5 +4,8 @@ module "jid" function split(jid) - return match(jid, "^([^@]+)@([^/]+)/?(.*)$"); + local node = match(jid, "^([^@]+)@"); + local server = (node and match(jid, ".-@([^@/]+)")) or match(jid, "^([^@/]+)"); + local resource = match(jid, "/(.+)$"); + return node, server, resource; end