Key = ejabberd_config:get_option(shared_key),
base64:encode(crypto:hash(sha, <<Data/binary, Key/binary>>)).
--spec callback(atom() | pid(), #iq{}, term()) -> any().
+-spec callback(atom() | pid(), #iq{} | timeout, term()) -> any().
callback(undefined, IQRes, Fun) ->
Fun(IQRes);
callback(Proc, IQRes, Ctx) ->
route(From, To, xmpp:make_error(Packet, Err))
end.
--spec route_iq(iq(), term()) -> ok.
-route_iq(IQ, State) ->
- route_iq(IQ, State, undefined, ?IQ_TIMEOUT).
+-spec route_iq(iq(), fun((iq() | timeout) -> any())) -> ok.
+route_iq(IQ, Fun) ->
+ route_iq(IQ, Fun, undefined, ?IQ_TIMEOUT).
-spec route_iq(iq(), term(), pid() | atom()) -> ok.
route_iq(IQ, State, Proc) ->