File

util/jid.lua @ 79:2766e23c4d7d

Removed: Unnecessary check in mod_roster. session.roster is guaranteed to be available for "c2s" session type.
author Waqas Hussain <waqas20@gmail.com>
date Wed, 08 Oct 2008 20:38:05 +0500
parent 29:b847875801e5
child 104: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