aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-10-18 07:47:00 +0200
committerKim Alvefur <zash@zash.se>2017-10-18 07:47:00 +0200
commitb85046ad44d2a8e3f8ab4f5432a34fede8cf128a (patch)
tree803e456154f6da2020bc9be63373ee0764b0c51d
parent7b30d1b18a4a53fecada187fec6228440ebbac5b (diff)
downloadprosody-b85046ad44d2a8e3f8ab4f5432a34fede8cf128a.tar.gz
prosody-b85046ad44d2a8e3f8ab4f5432a34fede8cf128a.zip
mod_pep_plus: Use dispatch function from pubsub.lib
-rw-r--r--plugins/mod_pep_plus.lua12
1 files changed, 2 insertions, 10 deletions
diff --git a/plugins/mod_pep_plus.lua b/plugins/mod_pep_plus.lua
index 53efe53e..9d5cca83 100644
--- a/plugins/mod_pep_plus.lua
+++ b/plugins/mod_pep_plus.lua
@@ -217,21 +217,13 @@ end
function handle_pubsub_iq(event)
local origin, stanza = event.origin, event.stanza;
- local pubsub_tag = stanza.tags[1];
- local action = pubsub_tag.tags[1];
- if not action then
- return origin.send(st.error_reply(stanza, "cancel", "bad-request"));
- end
local service_name = origin.username;
if stanza.attr.to ~= nil then
service_name = jid_split(stanza.attr.to);
end
local service = get_pep_service(service_name);
- local handler = handlers[stanza.attr.type.."_"..action.name];
- if handler then
- handler(origin, stanza, action, service);
- return true;
- end
+
+ return lib_pubsub.handle_pubsub_iq(event, service)
end
module:hook("iq/bare/"..xmlns_pubsub..":pubsub", handle_pubsub_iq);