# HG changeset patch # User Waqas Hussain # Date 1318447449 -18000 # Node ID d322c4553f97efbfb634699850e347e774471594 # Parent 676b0845eae44a9f763d2a2e5d8532d7351b7467 mod_saslauth: Never send empty , for real this time. diff -r 676b0845eae4 -r d322c4553f97 plugins/mod_saslauth.lua --- a/plugins/mod_saslauth.lua Thu Oct 13 00:13:49 2011 +0500 +++ b/plugins/mod_saslauth.lua Thu Oct 13 00:24:09 2011 +0500 @@ -248,15 +248,13 @@ return; end origin.sasl_handler = usermanager_get_sasl_handler(module.host); - local mechanisms = origin.sasl_handler:mechanisms(); - if not next(mechanisms) then return; end - features:tag("mechanisms", mechanisms_attr); - for mechanism in pairs(mechanisms) do + local mechanisms = st.stanza("mechanisms", mechanisms_attr); + for mechanism in pairs(origin.sasl_handler:mechanisms()) do if mechanism ~= "PLAIN" or origin.secure or allow_unencrypted_plain_auth then - features:tag("mechanism"):text(mechanism):up(); + mechanisms:tag("mechanism"):text(mechanism):up(); end end - features:up(); + if mechanisms[1] then features:add_child(mechanisms); end else features:tag("bind", bind_attr):tag("required"):up():up(); features:tag("session", xmpp_session_attr):tag("optional"):up():up();