# HG changeset patch # User Waqas Hussain # Date 1250164295 -18000 # Node ID 5eb8065905254ec9ed7a3eedb917664c32f4d952 # Parent a39a253b5b89925cef9df643240e410499d25068 mod_legacyauth: Refactored a bit diff -r a39a253b5b89 -r 5eb806590525 plugins/mod_legacyauth.lua --- a/plugins/mod_legacyauth.lua Thu Aug 13 16:46:08 2009 +0500 +++ b/plugins/mod_legacyauth.lua Thu Aug 13 16:51:35 2009 +0500 @@ -42,7 +42,6 @@ :tag("username"):up() :tag("password"):up() :tag("resource"):up()); - return true; else username, password, resource = t_concat(username), t_concat(password), t_concat(resource); local reply = st.reply(stanza); @@ -58,15 +57,9 @@ end end session.send(st.reply(stanza)); - return true; else - local reply = st.reply(stanza); - reply.attr.type = "error"; - reply:tag("error", { code = "401", type = "auth" }) - :tag("not-authorized", { xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas" }); - session.send(reply); - return true; + session.send(st.error_reply(stanza, "auth", "not-authorized")); end end - + return true; end);