24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-26 22:35:31 +02:00

* src/ejabberd_captcha.erl: fixed compilation warnings.

SVN Revision: 2004
This commit is contained in:
Evgeniy Khramtsov 2009-04-08 12:05:03 +00:00
parent ad0565cf7c
commit f80c848692
2 changed files with 18 additions and 10 deletions

View File

@ -1,3 +1,7 @@
2009-04-08 Evgeniy Khramtsov <ekhramtsov@process-one.net>
* src/ejabberd_captcha.erl: fixed compilation warnings.
2009-04-01 Badlop <badlop@process-one.net>
* doc/release_notes_2.0.5.txt: Added file for new release

View File

@ -85,11 +85,15 @@ create_captcha(Id, SID, From, To, Lang, Args)
OOB = {xmlelement, "x", [{"xmlns", ?NS_OOB}],
[{xmlelement, "url", [], [{xmlcdata, get_url(Id)}]}]},
Tref = erlang:send_after(?CAPTCHA_LIFETIME, ?MODULE, {remove_id, Id}),
?T(mnesia:write(#captcha{id=Id, pid=self(), key=Key,
tref=Tref, args=Args})),
case ?T(mnesia:write(#captcha{id=Id, pid=self(), key=Key,
tref=Tref, args=Args})) of
ok ->
{ok, [Body, OOB, Captcha, Data]};
_Err ->
error
end;
_Err ->
error
end.
%% @spec (Id::string(), Lang::string()) -> {FormEl, {ImgEl, TextEl, IdEl, KeyEl}} | captcha_not_found
@ -236,7 +240,7 @@ handle_cast(_Msg, State) ->
handle_info({remove_id, Id}, State) ->
?DEBUG("captcha ~p timed out", [Id]),
?T(case mnesia:read(captcha, Id, write) of
_ = ?T(case mnesia:read(captcha, Id, write) of
[#captcha{args=Args, pid=Pid}] ->
Pid ! {captcha_failed, Args},
mnesia:delete({captcha, Id});