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
commitb5b9b70c88a1287f034bceccdd953fe805bc78c6 (patch)
tree756544f4eab48d78f47b52589e3f2fedc88404b8 /plugins/mod_pubsub
parent7207a107fd582334d32af3d847ef8e939d136e97 (diff)
downloadprosody-b5b9b70c88a1287f034bceccdd953fe805bc78c6.tar.gz
prosody-b5b9b70c88a1287f034bceccdd953fe805bc78c6.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();