diff options
| author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2010-10-26 03:47:14 +1000 |
|---|---|---|
| committer | Badlop <badlop@process-one.net> | 2010-11-03 12:44:03 +0100 |
| commit | 773c54f91212ddf229cf1818b5fa031ef0c1f9f5 (patch) | |
| tree | 60d472814e95ce94c94b66b693432b3b3e8c40d3 | |
| parent | Changes in registration form to workaround client problems (EJAB-1262) (diff) | |
Add top-level instructions for x:data incompatible clients
| -rw-r--r-- | src/mod_register.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mod_register.erl b/src/mod_register.erl index c1b9c6d21..2a1598d78 100644 --- a/src/mod_register.erl +++ b/src/mod_register.erl @@ -204,6 +204,14 @@ process_iq(From, To, {false, [], []} end, if IsCaptchaEnabled and not IsRegistered -> + TopInstrEl = + #xmlel{ns = ?NS_INBAND_REGISTER, name = 'instructions', + children = + [#xmlcdata{cdata = + list_to_binary( + translate:translate(Lang, + "You need an x:data capable client " + "with CAPTCHA support to register"))}]}, InstrEl = #xmlel{ns = ?NS_INBAND_REGISTER, name = 'instructions', children = @@ -230,7 +238,7 @@ process_iq(From, To, case ejabberd_captcha:create_captcha_x( ID, To, Lang, [InstrEl, UField, PField]) of {ok, CaptchaEls} -> - Result = #xmlel{ns = ?NS_INBAND_REGISTER, name = 'query', children = CaptchaEls}, + Result = #xmlel{ns = ?NS_INBAND_REGISTER, name = 'query', children = [TopInstrEl | CaptchaEls]}, exmpp_iq:result(IQ_Rec, Result); error -> %% ErrText = "Unable to generate a captcha", |
