From 61047672429578e123eab5899a308e978beaf37e Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 24 Apr 2017 22:19:27 +0200 Subject: mod_pep: Split long line [luacheck] --- plugins/mod_pep.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua index 5d6485fa..7b1a50af 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 -- cgit v1.2.3 From 47c821cf549c8ea4645190a8f4bb18b7a2eaee2b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 24 Apr 2017 23:27:21 +0200 Subject: mod_pep: Handle disco#info queries to nodes (fixes #805) --- plugins/mod_pep.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua index 7b1a50af..1025be37 100644 --- a/plugins/mod_pep.lua +++ b/plugins/mod_pep.lua @@ -294,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 -- cgit v1.2.3 From 14df21dc9b9f3dc091d9bff4139c600ae00642b6 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 25 Apr 2017 00:14:19 +0200 Subject: mod_admin_telnet: Output human-friendly memory usage when meminfo is unavailable (thanks nbastin) --- plugins/mod_admin_telnet.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 04e93d7e..293f6320 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; -- cgit v1.2.3