25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Add top-level instructions for x:data incompatible clients

This commit is contained in:
Evgeniy Khramtsov 2010-10-26 03:47:14 +10:00 committed by Badlop
parent 82e8048a8a
commit 773c54f912

View File

@ -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",