aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2019-10-27 14:45:57 +0000
committerMatthew Wild <mwild1@gmail.com>2019-10-27 14:45:57 +0000
commit3496abfdacdb40cd401952b7512c1221e771280e (patch)
tree756544f4eab48d78f47b52589e3f2fedc88404b8 /plugins/mod_pubsub
parent9ba9680078871914ecf096ed74d996c71ae67494 (diff)
downloadprosody-3496abfdacdb40cd401952b7512c1221e771280e.tar.gz
prosody-3496abfdacdb40cd401952b7512c1221e771280e.zip
util.pubsub, pubsub.lib and tests: Add text to precondition-not-met error (fixes #1455)
Diffstat (limited to 'plugins/mod_pubsub')
-rw-r--r--plugins/mod_pubsub/pubsub.lib.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua
index a002fbe7..23695211 100644
--- a/plugins/mod_pubsub/pubsub.lib.lua
+++ b/plugins/mod_pubsub/pubsub.lib.lua
@@ -7,6 +7,7 @@ local st = require "util.stanza";
local it = require "util.iterators";
local uuid_generate = require "util.uuid".generate;
local dataform = require"util.dataforms".new;
+local errors = require "util.error";
local xmlns_pubsub = "http://jabber.org/protocol/pubsub";
local xmlns_pubsub_errors = "http://jabber.org/protocol/pubsub#errors";
@@ -34,6 +35,9 @@ local pubsub_errors = {
};
local function pubsub_error_reply(stanza, error)
local e = pubsub_errors[error];
+ if not e and errors.is_err(error) then
+ e = { error.type, error.condition, error.text, error.pubsub_condition };
+ end
local reply = st.error_reply(stanza, t_unpack(e, 1, 3));
if e[4] then
reply:tag(e[4], { xmlns = xmlns_pubsub_errors }):up();