aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_dialback.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_dialback.lua')
-rw-r--r--plugins/mod_dialback.lua16
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/mod_dialback.lua b/plugins/mod_dialback.lua
index 8c80dce6..91291e24 100644
--- a/plugins/mod_dialback.lua
+++ b/plugins/mod_dialback.lua
@@ -131,12 +131,22 @@ module:hook("stanza/jabber:server:dialback:result", function(event)
end
end);
+module:hook_stanza("urn:ietf:params:xml:ns:xmpp-sasl", "failure", function (origin, stanza)
+ if origin.external_auth == "failed" then
+ module:log("debug", "SASL EXTERNAL failed, falling back to dialback");
+ s2s_initiate_dialback(origin);
+ return true;
+ end
+end, 100);
+
module:hook_stanza(xmlns_stream, "features", function (origin, stanza)
- s2s_initiate_dialback(origin);
- return true;
+ if not origin.external_auth or origin.external_auth == "failed" then
+ s2s_initiate_dialback(origin);
+ return true;
+ end
end, 100);
-- Offer dialback to incoming hosts
module:hook("s2s-stream-features", function (data)
- data.features:tag("dialback", { xmlns='urn:xmpp:features:dialback' }):tag("optional"):up():up();
+ data.features:tag("dialback", { xmlns='urn:xmpp:features:dialback' }):up();
end);