diff options
Diffstat (limited to 'Swiftob')
-rw-r--r-- | Swiftob/LuaCommands.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Swiftob/LuaCommands.cpp b/Swiftob/LuaCommands.cpp index 27c44eb..bf43067 100644 --- a/Swiftob/LuaCommands.cpp +++ b/Swiftob/LuaCommands.cpp @@ -11,6 +11,11 @@ #include <algorithm> #include <iostream> +#ifdef LUA_HAVE_SOCKET +#include <3rdParty/Lua/luasocket/src/luasocket.h> +#include <3rdParty/Lua/luasocket/src/mime.h> +#endif + #include <Swiften/Base/foreach.h> #include <Swiften/Client/Client.h> #include <Swiften/Network/TimerFactory.h> @@ -403,6 +408,12 @@ void LuaCommands::loadScript(boost::filesystem::path filePath) { std::cout << "Trying to load file from " << filePath << std::endl; lua_State* lua = lua_open(); luaL_openlibs(lua); + +#ifdef LUA_HAVE_SOCKET + luaopen_socket_core(lua); + luaopen_mime_core(lua); +#endif + lua_pushlightuserdata(lua, this); lua_setfield(lua, LUA_REGISTRYINDEX, LUA_COMMANDS); std::string filename(filePath.filename()); |