# HG changeset patch # User Kim Alvefur # Date 1483953459 -3600 # Node ID 8a994208606853ad3aac54344b78c3652ead38d8 # Parent 4e365403169358ffb89a58140b458710ddb1b727# Parent ad709ee7d3d8f3d1a3dac02ab96499a870fcd32f Merge 0.10->trunk diff -r 4e3654031693 -r 8a9942086068 plugins/mod_register.lua --- a/plugins/mod_register.lua Fri Jan 06 17:01:48 2017 +0100 +++ b/plugins/mod_register.lua Mon Jan 09 10:17:39 2017 +0100 @@ -41,30 +41,37 @@ date = { name = "date", type = "text-single", label = "Birth date" }; }; +local title = module:get_option_string("registration_title", + "Creating a new account"); +local instructions = module:get_option_string("registration_instructions", + "Choose a username and password for use with this service."); + local registration_form = dataform_new{ - title = "Creating a new account"; - instructions = "Choose a username and password for use with this service."; + title = title; + instructions = instructions; field_map.username; field_map.password; }; local registration_query = st.stanza("query", {xmlns = "jabber:iq:register"}) - :tag("instructions"):text("Choose a username and password for use with this service."):up() + :tag("instructions"):text(instructions):up() :tag("username"):up() :tag("password"):up(); for _, field in ipairs(additional_fields) do if type(field) == "table" then registration_form[#registration_form + 1] = field; - else + elseif field_map[field] or field_map[field:sub(1, -2)] then if field:match("%+$") then - field = field:sub(1, #field - 1); + field = field:sub(1, -2); field_map[field].required = true; end registration_form[#registration_form + 1] = field_map[field]; registration_query:tag(field):up(); + else + module:log("error", "Unknown field %q", field); end end registration_query:add_child(registration_form:form()); diff -r 4e3654031693 -r 8a9942086068 tools/erlparse.lua --- a/tools/erlparse.lua Fri Jan 06 17:01:48 2017 +0100 +++ b/tools/erlparse.lua Mon Jan 09 10:17:39 2017 +0100 @@ -189,9 +189,9 @@ end; end -module "erlparse" +local _M = {}; -function parseFile(file) +function _M.parseFile(file) return readFile(file); end diff -r 4e3654031693 -r 8a9942086068 util-src/crand.c --- a/util-src/crand.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/crand.c Mon Jan 09 10:17:39 2017 +0100 @@ -130,6 +130,9 @@ #endif int luaopen_util_crand(lua_State *L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif lua_newtable(L); lua_pushcfunction(L, Lrandom); lua_setfield(L, -2, "bytes"); diff -r 4e3654031693 -r 8a9942086068 util-src/encodings.c --- a/util-src/encodings.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/encodings.c Mon Jan 09 10:17:39 2017 +0100 @@ -524,6 +524,9 @@ /***************** end *****************/ LUALIB_API int luaopen_util_encodings(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif #ifdef USE_STRINGPREP_ICU init_icu(); #endif diff -r 4e3654031693 -r 8a9942086068 util-src/hashes.c --- a/util-src/hashes.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/hashes.c Mon Jan 09 10:17:39 2017 +0100 @@ -212,6 +212,9 @@ }; LUALIB_API int luaopen_util_hashes(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif lua_newtable(L); luaL_setfuncs(L, Reg, 0);; lua_pushliteral(L, "-3.14"); diff -r 4e3654031693 -r 8a9942086068 util-src/net.c --- a/util-src/net.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/net.c Mon Jan 09 10:17:39 2017 +0100 @@ -125,6 +125,9 @@ } int luaopen_util_net(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif luaL_Reg exports[] = { { "local_addresses", lc_local_addresses }, { NULL, NULL } diff -r 4e3654031693 -r 8a9942086068 util-src/pposix.c --- a/util-src/pposix.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/pposix.c Mon Jan 09 10:17:39 2017 +0100 @@ -779,6 +779,9 @@ /* Register functions */ int luaopen_util_pposix(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif luaL_Reg exports[] = { { "abort", lc_abort }, diff -r 4e3654031693 -r 8a9942086068 util-src/ringbuffer.c --- a/util-src/ringbuffer.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/ringbuffer.c Mon Jan 09 10:17:39 2017 +0100 @@ -197,6 +197,9 @@ } int luaopen_util_ringbuffer(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif if(luaL_newmetatable(L, "ringbuffer_mt")) { lua_pushcfunction(L, rb_tostring); lua_setfield(L, -2, "__tostring"); diff -r 4e3654031693 -r 8a9942086068 util-src/signal.c --- a/util-src/signal.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/signal.c Mon Jan 09 10:17:39 2017 +0100 @@ -384,6 +384,9 @@ }; int luaopen_util_signal(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif int i = 0; /* add the library */ diff -r 4e3654031693 -r 8a9942086068 util-src/table.c --- a/util-src/table.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/table.c Mon Jan 09 10:17:39 2017 +0100 @@ -21,6 +21,9 @@ int luaopen_util_table(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif lua_newtable(L); lua_pushcfunction(L, Lcreate_table); lua_setfield(L, -2, "create"); diff -r 4e3654031693 -r 8a9942086068 util-src/windows.c --- a/util-src/windows.c Fri Jan 06 17:01:48 2017 +0100 +++ b/util-src/windows.c Mon Jan 09 10:17:39 2017 +0100 @@ -103,6 +103,9 @@ }; LUALIB_API int luaopen_util_windows(lua_State* L) { +#if (LUA_VERSION_NUM > 501) + luaL_checkversion(L); +#endif lua_newtable(L); luaL_setfuncs(L, Reg, 0); lua_pushliteral(L, "-3.14"); diff -r 4e3654031693 -r 8a9942086068 util/dependencies.lua --- a/util/dependencies.lua Fri Jan 06 17:01:48 2017 +0100 +++ b/util/dependencies.lua Mon Jan 09 10:17:39 2017 +0100 @@ -61,7 +61,7 @@ if not lxp then missingdep("luaexpat", { - ["Debian/Ubuntu"] = "sudo apt-get install liblua5.1-expat0"; + ["Debian/Ubuntu"] = "sudo apt-get install lua-expat"; ["luarocks"] = "luarocks install luaexpat"; ["Source"] = "http://matthewwild.co.uk/projects/luaexpat/"; }); @@ -72,7 +72,7 @@ if not socket then missingdep("luasocket", { - ["Debian/Ubuntu"] = "sudo apt-get install liblua5.1-socket2"; + ["Debian/Ubuntu"] = "sudo apt-get install lua-socket"; ["luarocks"] = "luarocks install luasocket"; ["Source"] = "http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/"; }); @@ -83,7 +83,7 @@ if not lfs then missingdep("luafilesystem", { ["luarocks"] = "luarocks install luafilesystem"; - ["Debian/Ubuntu"] = "sudo apt-get install liblua5.1-filesystem0"; + ["Debian/Ubuntu"] = "sudo apt-get install lua-filesystem"; ["Source"] = "http://www.keplerproject.org/luafilesystem/"; }); fatal = true;