Merge 0.10->trunk

This commit is contained in:
Kim Alvefur 2017-04-25 01:42:59 +02:00
commit d10300eca4
5 changed files with 21 additions and 4 deletions

View file

@ -325,7 +325,7 @@ end
function def_env.server:memory()
if not has_pposix or not pposix.meminfo then
return true, "Lua is using "..collectgarbage("count");
return true, "Lua is using "..human(collectgarbage("count"));
end
local mem, lua_mem = pposix.meminfo(), collectgarbage("count");
local print = self.session.print;

View file

@ -182,7 +182,8 @@ module:hook("iq/bare/http://jabber.org/protocol/pubsub:pubsub", function(event)
payload.attr.id = id;
session.send(st.reply(stanza));
module:fire_event("pep-publish-item", {
node = node, user = jid_bare(session.full_jid), actor = session.jid, id = id, session = session, item = st.clone(payload);
node = node, user = jid_bare(session.full_jid), actor = session.jid,
id = id, session = session, item = st.clone(payload);
});
return true;
else
@ -293,11 +294,21 @@ module:hook("account-disco-items", function(event)
if user_data then
for node, _ in pairs(user_data) do
reply:tag('item', {jid=bare, node=node}):up(); -- TODO we need to handle queries to these nodes
reply:tag('item', {jid=bare, node=node}):up();
end
end
end);
module:hook("account-disco-info-node", function (event)
local session, stanza, node = event.origin, event.stanza, event.node;
local user = stanza.attr.to;
local user_data = data[user];
if user_data and user_data[node] then
event.exists = true;
event.reply:tag('identity', {category='pubsub', type='leaf'}):up();
end
end);
module:hook("resource-unbind", function (event)
local user_bare_jid = event.session.username.."@"..event.session.host;
if not bare_sessions[user_bare_jid] then -- User went offline

View file

@ -936,7 +936,7 @@ function commands.cert(arg)
return cert_commands[subcmd](arg);
end
end
show_usage("cert config|request|generate|key", "Helpers for generating X.509 certificates and keys.")
show_usage("cert config|request|generate|key|import", "Helpers for generating X.509 certificates and keys.")
end
function commands.check(arg)

View file

@ -29,6 +29,10 @@
#if defined(WITH_GETRANDOM)
#ifndef __GLIBC_PREREQ
#define __GLIBC_PREREQ(a,b) 0
#endif
#if ! __GLIBC_PREREQ(2,25)
#include <unistd.h>
#include <sys/syscall.h>

View file

@ -187,6 +187,8 @@ local function getpid()
return false, "invalid-pidfile";
end
pidfile = config.resolve_relative_path(prosody.paths.data, pidfile);
local modules_enabled = set.new(config.get("*", "modules_disabled"));
if prosody.platform ~= "posix" or modules_enabled:contains("posix") then
return false, "no-posix";