view util/jid.lua @ 71:fbb4ef1da82e

Added: Local stanza routing
author Waqas Hussain <waqas20@gmail.com>
date Wed, 08 Oct 2008 04:49:55 +0500
parents b847875801e5
children cfbd3b849f9e
line wrap: on
line source


local match = string.match;

module "jid"

function split(jid)
	if not jid then return nil; end
	local node = match(jid, "^([^@]+)@");
	local server = (node and match(jid, ".-@([^@/]+)")) or match(jid, "^([^@/]+)");
	local resource = match(jid, "/(.+)$");
	return node, server, resource;
end