mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-24 17:29:28 +01:00
removed unnecessary gen_server call
SVN Revision: 2477
This commit is contained in:
parent
2c25db28c4
commit
9c0495b563
@ -150,10 +150,12 @@ route_iq(From, To, #iq{type = Type} = IQ, F) when is_function(F) ->
|
|||||||
end,
|
end,
|
||||||
ejabberd_router:route(From, To, Packet).
|
ejabberd_router:route(From, To, Packet).
|
||||||
|
|
||||||
register_iq_response_handler(Host, ID, Module, Fun) ->
|
register_iq_response_handler(_Host, ID, Module, Function) ->
|
||||||
gen_server:call(ejabberd_local,
|
TRef = erlang:start_timer(?IQ_TIMEOUT, ejabberd_local, ID),
|
||||||
{register_iq_response_handler,
|
mnesia:dirty_write(#iq_response{id = ID,
|
||||||
Host, ID, Module, Fun}).
|
module = Module,
|
||||||
|
function = Function,
|
||||||
|
timer = TRef}).
|
||||||
|
|
||||||
register_iq_handler(Host, XMLNS, Module, Fun) ->
|
register_iq_handler(Host, XMLNS, Module, Fun) ->
|
||||||
ejabberd_local ! {register_iq_handler, Host, XMLNS, Module, Fun}.
|
ejabberd_local ! {register_iq_handler, Host, XMLNS, Module, Fun}.
|
||||||
@ -211,14 +213,6 @@ init([]) ->
|
|||||||
%% {stop, Reason, State}
|
%% {stop, Reason, State}
|
||||||
%% Description: Handling call messages
|
%% Description: Handling call messages
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
handle_call({register_iq_response_handler, _Host,
|
|
||||||
ID, Module, Function}, _From, State) ->
|
|
||||||
TRef = erlang:start_timer(?IQ_TIMEOUT, self(), ID),
|
|
||||||
mnesia:dirty_write(#iq_response{id = ID,
|
|
||||||
module = Module,
|
|
||||||
function = Function,
|
|
||||||
timer = TRef}),
|
|
||||||
{reply, ok, State};
|
|
||||||
handle_call(_Request, _From, State) ->
|
handle_call(_Request, _From, State) ->
|
||||||
Reply = ok,
|
Reply = ok,
|
||||||
{reply, Reply, State}.
|
{reply, Reply, State}.
|
||||||
|
Loading…
Reference in New Issue
Block a user