util/import.lua

Fri, 24 Oct 2008 00:26:01 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Fri, 24 Oct 2008 00:26:01 +0500
changeset 151
096c7b9374fc
parent 49
1cd2a8db392d
child 519
cccd610a0ef9
permissions
-rw-r--r--

Presence fixes (again)
- Presence to other resources sent correctly
- Resource of the recipient ignored for all presence except available and unavailable
- Set things up for presence subscriptions


local t_insert = table.insert;
function import(module, ...)
	local m = package.loaded[module] or require(module);
	if type(m) == "table" and ... then
		local ret = {};
		for _, f in ipairs{...} do
			t_insert(ret, m[f]);
		end
		return unpack(ret);
	end
	return m;
end

mercurial