25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-28 16:34:13 +01:00

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