Improve some type specs

This commit is contained in:
Evgeniy Khramtsov 2017-11-11 09:33:42 +03:00
parent e77172a784
commit 76e9555d55
2 changed files with 4 additions and 4 deletions

View File

@ -169,7 +169,7 @@ calc_checksum(Data) ->
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) ->

View File

@ -142,9 +142,9 @@ route_error(From, To, Packet, #stanza_error{} = Err) ->
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) ->