aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-04-25 01:42:59 +0200
committerKim Alvefur <zash@zash.se>2017-04-25 01:42:59 +0200
commit30a4f36e03d8fad67839ee27ee037967ab50b385 (patch)
tree76b402f43306dd2f1a20dd5b16f9fe1bf9c15a42 /plugins
parentd53fffb30e060a0b2059d32707ac7b45966375f0 (diff)
parent42cd234969a1c68f54c6a804649ef9746e95f148 (diff)
downloadprosody-30a4f36e03d8fad67839ee27ee037967ab50b385.tar.gz
prosody-30a4f36e03d8fad67839ee27ee037967ab50b385.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_admin_telnet.lua2
-rw-r--r--plugins/mod_pep.lua15
2 files changed, 14 insertions, 3 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index 2f5d9f63..eae72e61 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -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;
diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua
index 5d6485fa..1025be37 100644
--- a/plugins/mod_pep.lua
+++ b/plugins/mod_pep.lua
@@ -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