util/import.lua

Thu, 09 Dec 2010 12:23:37 -0600

author
Robert Hoelz <rob@hoelz.ro>
date
Thu, 09 Dec 2010 12:23:37 -0600
changeset 3968
048af3ee5899
parent 2923
b7049746bd29
permissions
-rw-r--r--

core.offlinemanager, mod_message, mod_presence: Removed core.offlinemanager in favor of mod_offline.

-- Prosody IM
-- Copyright (C) 2008-2010 Matthew Wild
-- Copyright (C) 2008-2010 Waqas Hussain
-- 
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
--



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