25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Always include <actions/> with ad-hoc responses

XEP-0050 says: "The result for each stage (other than the last) of a
command's execution SHOULD include an <actions/> element."  Some clients
insist on this.
This commit is contained in:
Holger Weiss 2016-10-13 22:34:29 +02:00
parent b693601dd1
commit d97e777c9b

View File

@ -112,9 +112,17 @@ produce_response(
ProvidedSessionID /= <<"">> -> ProvidedSessionID;
true -> jlib:now_to_utc_string(p1_time_compat:timestamp())
end,
case Actions of
[] ->
case {Actions, Status} of
{[], completed} ->
ActionsEls = [];
{[], _} ->
ActionsEls = [
#xmlel{
name = <<"actions">>,
attrs = [{<<"execute">>, <<"complete">>}],
children = [#xmlel{name = <<"complete">>}]
}
];
_ ->
case DefaultAction of
<<"">> -> ActionsElAttrs = [];