File

util/jid.lua @ 105:b099f0f80775

Removed an unnecessary line
author Waqas Hussain <waqas20@gmail.com>
date Tue, 14 Oct 2008 09:56:14 +0500
parent 104:cfbd3b849f9e
child 109:7efedc96352a
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

return _M;