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:
parent
82e8048a8a
commit
773c54f912
@ -204,6 +204,14 @@ process_iq(From, To,
|
|||||||
{false, [], []}
|
{false, [], []}
|
||||||
end,
|
end,
|
||||||
if IsCaptchaEnabled and not IsRegistered ->
|
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 =
|
InstrEl =
|
||||||
#xmlel{ns = ?NS_INBAND_REGISTER, name = 'instructions',
|
#xmlel{ns = ?NS_INBAND_REGISTER, name = 'instructions',
|
||||||
children =
|
children =
|
||||||
@ -230,7 +238,7 @@ process_iq(From, To,
|
|||||||
case ejabberd_captcha:create_captcha_x(
|
case ejabberd_captcha:create_captcha_x(
|
||||||
ID, To, Lang, [InstrEl, UField, PField]) of
|
ID, To, Lang, [InstrEl, UField, PField]) of
|
||||||
{ok, CaptchaEls} ->
|
{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);
|
exmpp_iq:result(IQ_Rec, Result);
|
||||||
error ->
|
error ->
|
||||||
%% ErrText = "Unable to generate a captcha",
|
%% ErrText = "Unable to generate a captcha",
|
||||||
|
Loading…
Reference in New Issue
Block a user