92 session.send(st.error_reply(stanza, "cancel", "service-unavailable")); |
92 session.send(st.error_reply(stanza, "cancel", "service-unavailable")); |
93 end; |
93 end; |
94 end); |
94 end); |
95 |
95 |
96 module:add_iq_handler("c2s_unauthed", "jabber:iq:register", function (session, stanza) |
96 module:add_iq_handler("c2s_unauthed", "jabber:iq:register", function (session, stanza) |
97 if stanza.tags[1].name == "query" then |
97 if config.get(module.host, "core", "allow_registration") == false then |
|
98 session.send(st.error_reply(stanza, "cancel", "service-unavailable")); |
|
99 elseif stanza.tags[1].name == "query" then |
98 local query = stanza.tags[1]; |
100 local query = stanza.tags[1]; |
99 if stanza.attr.type == "get" then |
101 if stanza.attr.type == "get" then |
100 local reply = st.reply(stanza); |
102 local reply = st.reply(stanza); |
101 reply:tag("query", {xmlns = "jabber:iq:register"}) |
103 reply:tag("query", {xmlns = "jabber:iq:register"}) |
102 :tag("instructions"):text("Choose a username and password for use with this service."):up() |
104 :tag("instructions"):text("Choose a username and password for use with this service."):up() |