25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01: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> 2009-04-01 Badlop <badlop@process-one.net>
* doc/release_notes_2.0.5.txt: Added file for new release * doc/release_notes_2.0.5.txt: Added file for new release

View File

@ -85,9 +85,13 @@ create_captcha(Id, SID, From, To, Lang, Args)
OOB = {xmlelement, "x", [{"xmlns", ?NS_OOB}], OOB = {xmlelement, "x", [{"xmlns", ?NS_OOB}],
[{xmlelement, "url", [], [{xmlcdata, get_url(Id)}]}]}, [{xmlelement, "url", [], [{xmlcdata, get_url(Id)}]}]},
Tref = erlang:send_after(?CAPTCHA_LIFETIME, ?MODULE, {remove_id, Id}), Tref = erlang:send_after(?CAPTCHA_LIFETIME, ?MODULE, {remove_id, Id}),
?T(mnesia:write(#captcha{id=Id, pid=self(), key=Key, case ?T(mnesia:write(#captcha{id=Id, pid=self(), key=Key,
tref=Tref, args=Args})), tref=Tref, args=Args})) of
{ok, [Body, OOB, Captcha, Data]}; ok ->
{ok, [Body, OOB, Captcha, Data]};
_Err ->
error
end;
_Err -> _Err ->
error error
end. end.
@ -236,13 +240,13 @@ handle_cast(_Msg, State) ->
handle_info({remove_id, Id}, State) -> handle_info({remove_id, Id}, State) ->
?DEBUG("captcha ~p timed out", [Id]), ?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}] -> [#captcha{args=Args, pid=Pid}] ->
Pid ! {captcha_failed, Args}, Pid ! {captcha_failed, Args},
mnesia:delete({captcha, Id}); mnesia:delete({captcha, Id});
_ -> _ ->
ok ok
end), end),
{noreply, State}; {noreply, State};
handle_info(_Info, State) -> handle_info(_Info, State) ->