ok.
%-------------------------------------------------------------------------
-
+-spec get_local_commands(mod_disco:items_acc(), jid(), jid(), binary(), binary()) -> mod_disco:items_acc().
get_local_commands(Acc, _From,
#jid{server = Server, lserver = LServer} = _To, <<"">>,
Lang) ->
Acc.
%-------------------------------------------------------------------------
-
+-spec get_sm_commands(mod_disco:items_acc(), jid(), jid(), binary(), binary()) -> mod_disco:items_acc().
get_sm_commands(Acc, _From,
#jid{lserver = LServer} = To, <<"">>, Lang) ->
Display = mod_adhoc_opt:report_commands_node(LServer),
get_sm_commands(Acc, _From, _To, _Node, _Lang) -> Acc.
%-------------------------------------------------------------------------
-
+-spec get_local_identity([identity()], jid(), jid(), binary(), binary()) -> [identity()].
%% On disco info request to the ad-hoc node, return automation/command-list.
get_local_identity(Acc, _From, _To, ?NS_COMMANDS,
Lang) ->
Acc.
%-------------------------------------------------------------------------
-
+-spec get_sm_identity([identity()], jid(), jid(), binary(), binary()) -> [identity()].
%% On disco info request to the ad-hoc node, return automation/command-list.
get_sm_identity(Acc, _From, _To, ?NS_COMMANDS, Lang) ->
[#identity{category = <<"automation">>,
get_sm_identity(Acc, _From, _To, _Node, _Lang) -> Acc.
%-------------------------------------------------------------------------
--spec get_local_features({error, stanza_error()} | {result, [binary()]} | empty,
- jid(), jid(), binary(), binary()) ->
- {error, stanza_error()} | {result, [binary()]} | empty.
+-spec get_local_features(mod_disco:features_acc(), jid(), jid(), binary(), binary()) -> mod_disco:features_acc().
get_local_features(Acc, _From, _To, <<"">>, _Lang) ->
Feats = case Acc of
{result, I} -> I;
Acc.
%-------------------------------------------------------------------------
-
+-spec get_sm_features(mod_disco:features_acc(), jid(), jid(), binary(), binary()) -> mod_disco:features_acc().
get_sm_features(Acc, _From, _To, <<"">>, _Lang) ->
Feats = case Acc of
{result, I} -> I;
get_sm_features(Acc, _From, _To, _Node, _Lang) -> Acc.
%-------------------------------------------------------------------------
-
+-spec process_local_iq(iq()) -> iq() | ignore.
process_local_iq(IQ) ->
process_adhoc_request(IQ, local).
+-spec process_sm_iq(iq()) -> iq() | ignore.
process_sm_iq(IQ) ->
process_adhoc_request(IQ, sm).
+-spec process_adhoc_request(iq(), sm | local) -> iq() | ignore.
process_adhoc_request(#iq{from = From, to = To,
type = set, lang = Lang,
sub_els = [#adhoc_command{} = SubEl]} = IQ, Type) ->
process_adhoc_request(#iq{} = IQ, _Hooks) ->
xmpp:make_error(IQ, xmpp:err_bad_request()).
--spec ping_item(empty | {error, stanza_error()} | {result, [disco_item()]},
- jid(), jid(), binary()) -> {result, [disco_item()]}.
+-spec ping_item(mod_disco:items_acc(), jid(), jid(), binary()) -> {result, [disco_item()]}.
ping_item(Acc, _From, #jid{server = Server} = _To,
Lang) ->
Items = case Acc of
end;
ping_command(Acc, _From, _To, _Request) -> Acc.
+-spec fix_lang(binary(), adhoc_command()) -> adhoc_command().
fix_lang(Lang, #adhoc_command{lang = <<>>} = Cmd) ->
Cmd#adhoc_command{lang = Lang};
fix_lang(_, Cmd) ->